Skip to content

Commit c77486d

Browse files
committed
Get rid of spec-crosshair from gameplay. (Useless)
Reworked hookchain's: SetClientUserInfoName, GiveNamedItem Added hookchain's: DropShield, MakeVIP, MakeBomber, GetIntoGame, Disappear, Radio, StartObserver, OnSpawnEquip Refactoring
1 parent 0057943 commit c77486d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+2164
-1567
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
**/msvc/*.user
1414
**/msvc/*.suo
1515
**/msvc/*.txt
16+
**/msvc/*.amplxeproj
1617
**/msvc/ipch
1718

1819
regamedll/version/appversion.h

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Regamedll_CS is a result of reverse engineering of original library mods HLDS (b
88
* Provide more stable (than official) version of Counter-Strike game with extended API for mods and plugins
99

1010
## How can use it?
11-
Regamedll_CS is fully compatible with official mod CS 1.6 by Valve. All you have to do is to download binaries and replace original mo.dll/cs.so
11+
Regamedll_CS is fully compatible with official mod CS 1.6 / CZero by Valve. All you have to do is to download binaries and replace original mp.dll/cs.so
1212

1313
Compiled binaries are available here: [link](http://nexus.rehlds.org/nexus/content/repositories/regamedll-snapshots/regamedll/regamedll/0.2-SNAPSHOT/)
1414

@@ -22,20 +22,22 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
2222
| CVar | Default | Min | Max | Description |
2323
| :---------------------------- | :-----: | :-: | :----------: | :--------------------------------------------- |
2424
| mp_freeforall | 0 | 0 | 1 | The style of gameplay where there aren't any teams (FFA mode)<br/>`0` disabled <br/>`1` enabled |
25+
| mp_autoteambalance | 1 | 0 | 2 | Auto balancing of teams<br/>`0` disabled <br/>`1` on after next round<br/>`2` on next round |
2526
| mp_buytime | 1.5 | 0.0 | - | Designate the desired amount of buy time for each round. (in minutes)<br />`-1` means no time limit<br />`0` disable buy |
2627
| mp_maxmoney | 16000 | 0 | `0x7FFFFFFF` | The maximum allowable amount of money in the game |
2728
| mp_round_infinite | 0 | 0 | 1 | Flags for fine grained control (choose as many as needed)<br/>`0` disabled<br/>`1` enabled<br/><br/>or flags<br/>`a` block round time round end check<br/>`b` block needed players round end check<br/>`c` block VIP assassination/success round end check<br/>`d` block prison escape round end check<br/>`e` block bomb round end check<br/>`f` block team extermination round end check<br/>`g` block hostage rescue round end check<br/><br/>`Example setting:` "ae" blocks round time and bomb round end checks |
2829
| mp_hegrenade_penetration | 0 | 0 | 1 | Disable grenade damage through walls<br/>`0` disabled<br/>`1` enabled |
29-
| mp_nadedrops | 0 | 0 | 2 | Drop a grenade after player death<br/>`0` disabled<br/>`1` drop one the grenade<br/>`2` drop a everyone grenades |
30+
| mp_nadedrops | 0 | 0 | 2 | Drop a grenade after player death<br/>`0` disabled<br/>`1` drop one the grenade<br/>`2` drop an everyone grenades |
3031
| mp_roundrespawn_time | 20 | 0 | - | Player cannot respawn until next round if more than N seconds has elapsed since the beginning round |
3132
| mp_auto_reload_weapons | 0 | 0 | 1 | Automatically reload each weapon on player spawn<br/>`0` disabled<br/>`1` enabled |
32-
| mp_refill_bpammo_weapons | 0 | 0 | 2 | Refill amount of backpack ammo up to the max<br/>`0` disabled<br/>`1` refill backpack ammo on player spawn<br/>`2` refill backpack ammo on each weapon reload |
33+
| mp_refill_bpammo_weapons | 0 | 0 | 3 | Refill amount of backpack ammo up to the max<br/>`0` disabled<br/>`1` refill backpack ammo on player spawn<br/>`2` refill backpack ammo on player spawn and on the purchase of the item<br/>`3` refill backpack ammo on each weapon reload |
3334
| mp_auto_join_team | 0 | 0 | 1 | Automatically joins the team <br/>`0` disabled<br/>`1` enable (Use in conjunction with the cvar humans_join_team any/CT/T) |
3435
| mp_max_teamkills | 3 | 0 | - | Maximum number of allowed teamkills before autokick. Used when enabled mp_autokick. |
3536
| mp_fragsleft | - | - | - | Is the number of frags left, if you have set mp_fraglimit. You just type mp_fragsleft in server console, and it tells you the number of frags left depending of mp_fraglimit. |
3637
| mp_fraglimit | 0 | - | - | If set to something other than 0, when anybody’s scored reaches mp_fraglimit the server changes map.<br />`0` means no limit |
3738
| mp_timeleft | - | - | - | Is the number of time left before the map changes, if you have set mp_timelimit. You just type mp_timeleft in server console, and it tells you the number of time left depending of mp_timelimit. |
3839
| mp_timelimit | 0 | - | - | Period between map rotations.<br />`0` means no limit |
40+
| mp_roundover | 0 | - | - | The round by expired time will be over, if on a map it does not have the scenario of the game.<br/>`0` disabled<br/>`1` enabled |
3941
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
4042
| bot_deathmatch | 0 | 0 | 1 | Set's the mode for the zBot <br/>`0` disabled<br/>`1` enable mode Deathmatch and not allow to do the scenario |
4143

dist/game.cfg

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,14 @@ echo Executing ReGameDLL Configuration File
88
// Default value: "0"
99
mp_freeforall 0
1010
11+
// Auto balancing of teams
12+
// 0 - disabled
13+
// 1 - on after next round (default behaviour)
14+
// 2 - on next round
15+
//
16+
// Default value: "1"
17+
mp_autoteambalance 1
18+
1119
// Designate the desired amount of buy time for each round. (in minutes)
1220
// -1 - means no time limit
1321
// 0 - disable buy
@@ -37,6 +45,12 @@ mp_maxmoney 16000
3745
// Default value: "0"
3846
mp_round_infinite 0
3947
48+
// The round by expired time will be over, if on a map it does not have the scenario of the game.
49+
// 0 - disabled (default behaviour)
50+
// 1 - enabled
51+
// Default value: "0"
52+
mp_roundover 0
53+
4054
// Disable grenade damage through walls
4155
// 0 - disabled
4256
// 1 - enabled
@@ -46,7 +60,7 @@ mp_hegrenade_penetration 0
4660
// Drop a grenade after player death
4761
// 0 - disabled
4862
// 1 - drop one the grenade
49-
// 2 - drop a everyone grenades
63+
// 2 - drop an everyone grenades
5064
// Default value: "0"
5165
mp_nadedrops 0
5266
@@ -66,7 +80,8 @@ mp_auto_reload_weapons "0"
6680
// Refill amount of backpack ammo up to the max
6781
// 0 - disabled (default behaviour)
6882
// 1 - refill backpack ammo on player spawn
69-
// 2 - refill backpack ammo on each weapon reload (NOTE: Useful for mods like DeathMatch, GunGame, ZombieMod etc.)
83+
// 2 - refill backpack ammo on player spawn and on the purchase of the item
84+
// 3 - refill backpack ammo on each weapon reload (NOTE: Useful for mods like DeathMatch, GunGame, ZombieMod etc.)
7085
//
7186
// Default value: "0"
7287
mp_refill_bpammo_weapons 0

regamedll/common/const.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@
122122
#define DEAD_NO 0 // alive
123123
#define DEAD_DYING 1 // playing death animation or still falling off of a ledge waiting to hit ground
124124
#define DEAD_DEAD 2 // dead. lying still.
125-
#define DEAD_RESPAWNABLE 3
125+
#define DEAD_RESPAWNABLE 3 // do respawn the entity
126126
#define DEAD_DISCARDBODY 4
127127

128128
#define DAMAGE_NO 0

regamedll/dlls/ammo.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ void C9MMAmmo::__MAKE_VHOOK(Precache)()
1515

1616
BOOL C9MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
1717
{
18-
if (pOther->GiveAmmo(AMMO_9MM_BUY, "9mm", MAX_AMMO_9MM) == -1)
18+
if (pOther->GiveAmmo(AMMO_9MM_BUY, "9mm") == -1)
1919
{
2020
return FALSE;
2121
}
@@ -41,7 +41,7 @@ void CBuckShotAmmo::__MAKE_VHOOK(Precache)()
4141

4242
BOOL CBuckShotAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
4343
{
44-
if (pOther->GiveAmmo(AMMO_BUCKSHOT_BUY, "buckshot", MAX_AMMO_BUCKSHOT) == -1)
44+
if (pOther->GiveAmmo(AMMO_BUCKSHOT_BUY, "buckshot") == -1)
4545
{
4646
return FALSE;
4747
}
@@ -67,7 +67,7 @@ void C556NatoAmmo::__MAKE_VHOOK(Precache)()
6767

6868
BOOL C556NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
6969
{
70-
if (pOther->GiveAmmo(AMMO_556NATO_BUY, "556Nato", MAX_AMMO_556NATO) == -1)
70+
if (pOther->GiveAmmo(AMMO_556NATO_BUY, "556Nato") == -1)
7171
{
7272
return FALSE;
7373
}
@@ -93,7 +93,7 @@ void C556NatoBoxAmmo::__MAKE_VHOOK(Precache)()
9393

9494
BOOL C556NatoBoxAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
9595
{
96-
if (pOther->GiveAmmo(AMMO_556NATOBOX_BUY, "556NatoBox", MAX_AMMO_556NATOBOX) == -1)
96+
if (pOther->GiveAmmo(AMMO_556NATOBOX_BUY, "556NatoBox") == -1)
9797
{
9898
return FALSE;
9999
}
@@ -119,7 +119,7 @@ void C762NatoAmmo::__MAKE_VHOOK(Precache)()
119119

120120
BOOL C762NatoAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
121121
{
122-
if (pOther->GiveAmmo(AMMO_762NATO_BUY, "762Nato", MAX_AMMO_762NATO) == -1)
122+
if (pOther->GiveAmmo(AMMO_762NATO_BUY, "762Nato") == -1)
123123
{
124124
return FALSE;
125125
}
@@ -145,7 +145,7 @@ void C45ACPAmmo::__MAKE_VHOOK(Precache)()
145145

146146
BOOL C45ACPAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
147147
{
148-
if (pOther->GiveAmmo(AMMO_45ACP_BUY, "45acp", MAX_AMMO_45ACP) == -1)
148+
if (pOther->GiveAmmo(AMMO_45ACP_BUY, "45acp") == -1)
149149
{
150150
return FALSE;
151151
}
@@ -171,7 +171,7 @@ void C50AEAmmo::__MAKE_VHOOK(Precache)()
171171

172172
BOOL C50AEAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
173173
{
174-
if (pOther->GiveAmmo(AMMO_50AE_BUY, "50AE", MAX_AMMO_50AE) == -1)
174+
if (pOther->GiveAmmo(AMMO_50AE_BUY, "50AE") == -1)
175175
{
176176
return FALSE;
177177
}
@@ -197,7 +197,7 @@ void C338MagnumAmmo::__MAKE_VHOOK(Precache)()
197197

198198
BOOL C338MagnumAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
199199
{
200-
if (pOther->GiveAmmo(AMMO_338MAG_BUY, "338Magnum", MAX_AMMO_338MAGNUM) == -1)
200+
if (pOther->GiveAmmo(AMMO_338MAG_BUY, "338Magnum") == -1)
201201
{
202202
return FALSE;
203203
}
@@ -223,7 +223,7 @@ void C57MMAmmo::__MAKE_VHOOK(Precache)()
223223

224224
BOOL C57MMAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
225225
{
226-
if (pOther->GiveAmmo(AMMO_57MM_BUY, "57mm", MAX_AMMO_57MM) == -1)
226+
if (pOther->GiveAmmo(AMMO_57MM_BUY, "57mm") == -1)
227227
{
228228
return FALSE;
229229
}
@@ -249,7 +249,7 @@ void C357SIGAmmo::__MAKE_VHOOK(Precache)()
249249

250250
BOOL C357SIGAmmo::__MAKE_VHOOK(AddAmmo)(CBaseEntity *pOther)
251251
{
252-
if (pOther->GiveAmmo(AMMO_357SIG_BUY, "357SIG", MAX_AMMO_357SIG) == -1)
252+
if (pOther->GiveAmmo(AMMO_357SIG_BUY, "357SIG") == -1)
253253
{
254254
return FALSE;
255255
}

regamedll/dlls/bot/cs_bot.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -588,13 +588,13 @@ void CCSBot::UpdateHostageEscortCount()
588588
m_hostageEscortCount = 0;
589589

590590
CHostage *hostage = NULL;
591-
while ((hostage = static_cast<CHostage *>(UTIL_FindEntityByClassname(hostage, "hostage_entity"))) != NULL)
591+
while ((hostage = static_cast<CHostage *>(UTIL_FindEntityByClassname(hostage, "hostage_entity"))))
592592
{
593593
if (FNullEnt(hostage->edict()))
594594
break;
595595

596596
// skip dead or rescued hostages
597-
if (!hostage->IsValid())
597+
if (!hostage->IsAlive())
598598
continue;
599599

600600
// check if hostage has targeted us, and is following

regamedll/dlls/bot/cs_bot_manager.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,7 @@ void CCSBotManager::__MAKE_VHOOK(RestartRound)()
102102
ResetRadioMessageTimestamps();
103103

104104
m_lastSeenEnemyTimestamp = -9999.9f;
105-
106-
m_roundStartTimestamp = gpGlobals->time + CVAR_GET_FLOAT("mp_freezetime");
105+
m_roundStartTimestamp = gpGlobals->time + freezetime.value;
107106

108107
// randomly decide if defensive team wants to "rush" as a whole
109108
const float defenseRushChance = 33.3f; // 25.0f;

regamedll/dlls/bot/cs_gamestate.cpp

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -293,12 +293,12 @@ void CSGameState::InitializeHostageInfo()
293293
m_haveSomeHostagesBeenTaken = false;
294294

295295
CBaseEntity *hostage = NULL;
296-
while ((hostage = UTIL_FindEntityByClassname(hostage, "hostage_entity")) != NULL)
296+
while ((hostage = UTIL_FindEntityByClassname(hostage, "hostage_entity")))
297297
{
298298
if (m_hostageCount >= MAX_HOSTAGES)
299299
break;
300300

301-
if (hostage->pev->takedamage != DAMAGE_YES)
301+
if (!hostage->IsAlive())
302302
continue;
303303

304304
m_hostage[m_hostageCount].hostage = static_cast<CHostage *>(hostage);
@@ -338,7 +338,7 @@ CHostage *CSGameState::GetNearestFreeHostage(Vector *knowPos) const
338338
if (m_owner->m_iTeam == CT)
339339
{
340340
// we know exactly where the hostages are, and if they are alive
341-
if (!m_hostage[i].hostage || !m_hostage[i].hostage->IsValid())
341+
if (!m_hostage[i].hostage || !m_hostage[i].hostage->IsAlive())
342342
continue;
343343

344344
if (m_hostage[i].hostage->IsFollowingSomeone())
@@ -457,7 +457,7 @@ CSGameState::ValidateStatusType CSGameState::ValidateHostagePositions()
457457
// if we can see a hostage, update our knowledge of it
458458
if (m_owner->IsVisible(&info->hostage->pev->origin, CHECK_FOV))
459459
{
460-
if (info->hostage->pev->takedamage == DAMAGE_YES)
460+
if (info->hostage->IsAlive())
461461
{
462462
// live hostage
463463
// if hostage is being escorted by a CT, we don't "see" it, we see the CT
@@ -494,7 +494,7 @@ CSGameState::ValidateStatusType CSGameState::ValidateHostagePositions()
494494
if (m_owner->IsVisible(&info->knownPos, CHECK_FOV))
495495
{
496496
// we can see where we thought the hostage was - verify it is still there and alive
497-
if (info->hostage->pev->takedamage != DAMAGE_YES)
497+
if (!info->hostage->IsAlive())
498498
{
499499
// since we have line of sight to an invalid hostage, it must be dead
500500
// discovered that hostage has been killed
@@ -559,7 +559,7 @@ CHostage *CSGameState::GetNearestVisibleFreeHostage() const
559559
continue;
560560

561561
// if the hostage is dead or rescued, its not free
562-
if (info->hostage->pev->takedamage != DAMAGE_YES)
562+
if (!info->hostage->IsAlive())
563563
continue;
564564

565565
// if this hostage is following someone, its not free
@@ -591,15 +591,14 @@ bool CSGameState::AreAllHostagesBeingRescued() const
591591
return false;
592592

593593
bool isAllDead = true;
594-
595594
for (int i = 0; i < m_hostageCount; ++i)
596595
{
597596
const HostageInfo *info = &m_hostage[i];
598597

599598
if (m_owner->m_iTeam == CT)
600599
{
601600
// CT's have perfect knowledge via their radar
602-
if (info->hostage != NULL && info->hostage->IsValid())
601+
if (info->hostage && info->hostage->IsAlive())
603602
{
604603
if (!info->hostage->IsFollowingSomeone())
605604
return false;
@@ -638,7 +637,7 @@ bool CSGameState::AreAllHostagesGone() const
638637
if (m_owner->m_iTeam == CT)
639638
{
640639
// CT's have perfect knowledge via their radar
641-
if (info->hostage->IsAlive())// == DAMAGE_YES)
640+
if (info->hostage->IsAlive())
642641
return false;
643642
}
644643
else

regamedll/dlls/bot/states/cs_bot_move_to.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ void MoveToState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
172172
// Since CT's have a radar, they can directly look at the actual hostage state
173173
// check if someone else collected our hostage, or the hostage died or was rescued
174174
CHostage *hostage = static_cast<CHostage *>(me->GetGoalEntity());
175-
if (hostage == NULL || !hostage->IsValid() || hostage->IsFollowingSomeone())
175+
if (!hostage || !hostage->IsAlive() || hostage->IsFollowingSomeone())
176176
{
177177
me->Idle();
178178
return;

0 commit comments

Comments
 (0)