Refactoring
Some small fixes and improves
Reworked mp_forcerespawn and hookchain InternalCommand
Fixed fail compilation in VisualStudio
Bump minor version in gradle.properties
Update README.md
This commit is contained in:
s1lentq 2017-01-20 21:52:37 +07:00
parent faff55df78
commit a5dac3c267
34 changed files with 400 additions and 301 deletions

@ -22,25 +22,26 @@ Archive's bin directory contains 2 subdirectories, 'bugfixed' and 'pure'
| CVar | Default | Min | Max | Description | | CVar | Default | Min | Max | Description |
| :---------------------------- | :-----: | :-: | :----------: | :--------------------------------------------- | | :---------------------------- | :-----: | :-: | :----------: | :--------------------------------------------- |
| mp_freeforall | 0 | 0 | 1 | The style of gameplay where there aren't any teams (FFA mode)<br/>`0` disabled <br/>`1` enabled | | mp_freeforall | 0 | 0 | 1 | The style of gameplay where there aren't any teams (FFA mode)<br/>`0` disabled <br/>`1` enabled |
| mp_autoteambalance | 1 | 0 | 2 | Auto balancing of teams<br/>`0` disabled <br/>`1` on after next round<br/>`2` on next round | | mp_autoteambalance | 1 | 0 | 2 | Auto balancing of teams.<br/>`0` disabled <br/>`1` on after next round<br/>`2` on next round |
| 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 | | 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 |
| mp_maxmoney | 16000 | 0 | `0x7FFFFFFF` | The maximum allowable amount of money in the game | | mp_maxmoney | 16000 | 0 | `0x7FFFFFFF` | The maximum allowable amount of money in the game |
| 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 | | 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 |
| 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 | | 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 |
| mp_hegrenade_penetration | 0 | 0 | 1 | Disable grenade damage through walls<br/>`0` disabled<br/>`1` enabled | | mp_hegrenade_penetration | 0 | 0 | 1 | Disable grenade damage through walls.<br/>`0` disabled<br/>`1` enabled |
| 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 | | 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 |
| mp_roundrespawn_time | 20 | 0 | - | Player cannot respawn until next round if more than N seconds has elapsed since the beginning round | | mp_roundrespawn_time | 20 | 0 | - | Player cannot respawn until next round if more than N seconds has elapsed since the beginning round |
| mp_auto_reload_weapons | 0 | 0 | 1 | Automatically reload each weapon on player spawn<br/>`0` disabled<br/>`1` enabled | | mp_auto_reload_weapons | 0 | 0 | 1 | Automatically reload each weapon on player spawn.<br/>`0` disabled<br/>`1` enabled |
| 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 | | 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 |
| 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) | | 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) |
| mp_max_teamkills | 3 | 0 | - | Maximum number of allowed teamkills before autokick. Used when enabled mp_autokick. | | mp_max_teamkills | 3 | 0 | - | Maximum number of allowed teamkills before autokick. Used when enabled mp_autokick. |
| 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. | | 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. |
| mp_fraglimit | 0 | - | - | If set to something other than 0, when anybodys scored reaches mp_fraglimit the server changes map.<br />`0` means no limit | | mp_fraglimit | 0 | - | - | If set to something other than 0, when anybodys scored reaches mp_fraglimit the server changes map.<br />`0` means no limit |
| 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. | | 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. |
| mp_timelimit | 0 | - | - | Period between map rotations.<br />`0` means no limit | | mp_timelimit | 0 | - | - | Period between map rotations.<br />`0` means no limit |
| mp_forcerespawn | 0 | 0 | - | Players will automatically respawn when killed.<br/>`0` disabled<br/>`>0` time delay to respawn | | mp_forcerespawn | 0 | 0 | - | Players will automatically respawn when killed.<br/>`0` disabled<br/>`>0.00001` time delay to respawn |
| mp_hostage_hurtable | 1 | 0 | 1 | The hostages can take the damage.<br/>`0` disabled<br/>`1` enabled |
| showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. | | showtriggers | 0 | 0 | 1 | Debug cvar shows triggers. |
| 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 | | 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 |
## How to install zBot for CS 1.6? ## How to install zBot for CS 1.6?
* Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true) * Extract all the files from an [archive](regamedll/extra/zBot/bot_profiles.zip?raw=true)

26
dist/game.cfg vendored

@ -86,16 +86,9 @@ mp_auto_reload_weapons "0"
// Default value: "0" // Default value: "0"
mp_refill_bpammo_weapons 0 mp_refill_bpammo_weapons 0
// Set's the mode for the zBot
// 0 - disabled
// 1 - enable mode Deathmatch and not allow to do the scenario
//
// Default value: "0"
bot_deathmatch 0
// Automatically joins the team // Automatically joins the team
// 0 - disabled // 0 - disabled
// 1 - enable (Use in conjunction with the cvar humans_join_team any/CT/T) // 1 - enabled (Use in conjunction with the cvar humans_join_team any/CT/T)
// //
// Default value: "0" // Default value: "0"
mp_auto_join_team 0 mp_auto_join_team 0
@ -122,13 +115,26 @@ mp_timelimit 20
// Players will automatically respawn when killed. // Players will automatically respawn when killed.
// 0 - disabled // 0 - disabled
// >0 - time delay to respawn // >0.00001 - time delay to respawn
// //
// Default value: "0" // Default value: "0"
mp_forcerespawn 0 mp_forcerespawn 0
// Debug cvar shows triggers. // The hostages can take the damage.
// 0 - disabled // 0 - disabled
// 1 - enabled (default behaviour)
mp_hostage_hurtable 1
// Set's the mode for the zBot
// 0 - disabled
// 1 - enable mode Deathmatch and not allow to do the scenario
//
// Default value: "0"
bot_deathmatch 0
// Debug cvar shows triggers.
// 0 - disabled (default behaviour)
// 1 - enabled
// //
// Default value: "0" // Default value: "0"
showtriggers 0 showtriggers 0

@ -1,3 +1,3 @@
majorVersion=5 majorVersion=5
minorVersion=0 minorVersion=1
maintenanceVersion=0 maintenanceVersion=0

@ -1148,11 +1148,11 @@ void SV_StudioSetupBones(model_t *pModel, float frame, int sequence, const vec_t
{ {
if (!Q_strcmp(pbones[i].name, "Bip01 Spine")) if (!Q_strcmp(pbones[i].name, "Bip01 Spine"))
{ {
bCopy = 0; bCopy = false;
} }
else if (!Q_strcmp(pbones[pbones[i].parent].name, "Bip01 Pelvis")) else if (!Q_strcmp(pbones[pbones[i].parent].name, "Bip01 Pelvis"))
{ {
bCopy = 1; bCopy = true;
} }
if (bCopy) if (bCopy)

@ -158,7 +158,7 @@ LINK_ENTITY_TO_CLASS(func_illusionary, CFuncIllusionary, CCSFuncIllusionary);
void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd) void CFuncIllusionary::__MAKE_VHOOK(KeyValue)(KeyValueData *pkvd)
{ {
//skin is used for content type // skin is used for content type
if (FStrEq(pkvd->szKeyName, "skin")) if (FStrEq(pkvd->szKeyName, "skin"))
{ {
pev->skin = Q_atoi(pkvd->szValue); pev->skin = Q_atoi(pkvd->szValue);

@ -65,7 +65,7 @@ CCSBotManager::CCSBotManager()
const char *dataFile = SharedParse(dataPointer); const char *dataFile = SharedParse(dataPointer);
const char *token; const char *token;
while (dataFile != NULL) while (dataFile)
{ {
token = SharedGetToken(); token = SharedGetToken();
char *clone = CloneString(token); char *clone = CloneString(token);
@ -627,7 +627,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
break; break;
} }
if (found != NULL) if (found)
{ {
isAmbiguous = true; isAmbiguous = true;
} }
@ -669,10 +669,10 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
{ {
// tell the first bot we find to go to our marked area // tell the first bot we find to go to our marked area
CNavArea *area = GetMarkedArea(); CNavArea *area = GetMarkedArea();
if (area != NULL) if (area)
{ {
CBaseEntity *pEntity = NULL; CBaseEntity *pEntity = NULL;
while ((pEntity = UTIL_FindEntityByClassname(pEntity, "player")) != NULL) while ((pEntity = UTIL_FindEntityByClassname(pEntity, "player")))
{ {
if (!pEntity->IsPlayer()) if (!pEntity->IsPlayer())
continue; continue;
@ -685,7 +685,7 @@ void CCSBotManager::__MAKE_VHOOK(ServerCommand)(const char *pcmd)
if (playerOrBot->IsBot()) if (playerOrBot->IsBot())
{ {
CCSBot *bot = static_cast<CCSBot *>(playerOrBot); CCSBot *bot = static_cast<CCSBot *>(playerOrBot);
if (bot != NULL) if (bot)
{ {
bot->MoveTo(&area->m_center, FASTEST_ROUTE); bot->MoveTo(&area->m_center, FASTEST_ROUTE);
} }
@ -811,7 +811,7 @@ bool CCSBotManager::BotAddCommand(BotProfileTeamType team, bool isFromConsole)
{ {
// in career, ignore humans // in career, ignore humans
bool ignoreHumans = false; bool ignoreHumans = false;
if (CSGameRules() != NULL && CSGameRules()->IsCareer()) if (CSGameRules() && CSGameRules()->IsCareer())
ignoreHumans = true; ignoreHumans = true;
if (UTIL_IsNameTaken(CMD_ARGV(1), ignoreHumans)) if (UTIL_IsNameTaken(CMD_ARGV(1), ignoreHumans))
@ -940,7 +940,7 @@ void CCSBotManager::MaintainBotQuota()
} }
else else
{ {
if (CSGameRules() != NULL && !CSGameRules()->IsCareer()) if (CSGameRules() && !CSGameRules()->IsCareer())
return; return;
bool humansAreCTs = (Q_strcmp(humans_join_team.string, "CT") == 0); bool humansAreCTs = (Q_strcmp(humans_join_team.string, "CT") == 0);
@ -1091,7 +1091,8 @@ void CCSBotManager::ValidateMapData()
m_zone[ m_zoneCount ].m_center = (isLegacy) ? entity->pev->origin : (entity->pev->absmax + entity->pev->absmin) / 2.0f; m_zone[ m_zoneCount ].m_center = (isLegacy) ? entity->pev->origin : (entity->pev->absmax + entity->pev->absmin) / 2.0f;
m_zone[ m_zoneCount ].m_isLegacy = isLegacy; m_zone[ m_zoneCount ].m_isLegacy = isLegacy;
m_zone[ m_zoneCount ].m_index = m_zoneCount; m_zone[ m_zoneCount ].m_index = m_zoneCount;
m_zone[ m_zoneCount++ ].m_entity = entity; m_zone[ m_zoneCount ].m_entity = entity;
m_zoneCount++;
} }
else else
CONSOLE_ECHO("Warning: Too many zones, some will be ignored.\n"); CONSOLE_ECHO("Warning: Too many zones, some will be ignored.\n");
@ -1104,8 +1105,13 @@ void CCSBotManager::ValidateMapData()
{ {
entity = NULL; entity = NULL;
while ((entity = UTIL_FindEntityByClassname(entity, "info_player_start")) != NULL) while ((entity = UTIL_FindEntityByClassname(entity, "info_player_start")))
{ {
#ifdef REGAMEDLL_FIXES
if (m_zoneCount >= MAX_ZONES)
break;
#endif
if (FNullEnt(entity->edict())) if (FNullEnt(entity->edict()))
break; break;
@ -1114,7 +1120,8 @@ void CCSBotManager::ValidateMapData()
m_zone[ m_zoneCount ].m_center = entity->pev->origin; m_zone[ m_zoneCount ].m_center = entity->pev->origin;
m_zone[ m_zoneCount ].m_isLegacy = true; m_zone[ m_zoneCount ].m_isLegacy = true;
m_zone[ m_zoneCount ].m_index = m_zoneCount; m_zone[ m_zoneCount ].m_index = m_zoneCount;
m_zone[ m_zoneCount++ ].m_entity = entity; m_zone[ m_zoneCount ].m_entity = entity;
m_zoneCount++;
} }
else else
CONSOLE_ECHO("Warning: Too many zones, some will be ignored.\n"); CONSOLE_ECHO("Warning: Too many zones, some will be ignored.\n");
@ -1207,9 +1214,8 @@ bool CCSBotManager::AddBot(const BotProfile *profile, BotProfileTeamType team)
if (HandleMenu_ChooseTeam(pBot, nTeamSlot)) if (HandleMenu_ChooseTeam(pBot, nTeamSlot))
{ {
int skin = profile->GetSkin(); int skin = profile->GetSkin();
if (!skin) if (!skin)
skin = 6;// MODEL_GIGN? skin = 6;
HandleMenu_ChooseAppearance(pBot, skin); HandleMenu_ChooseAppearance(pBot, skin);

@ -48,7 +48,7 @@ void DefuseBombState::__MAKE_VHOOK(OnUpdate)(CCSBot *me)
if (!TheCSBots()->IsBombPlanted()) if (!TheCSBots()->IsBombPlanted())
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (CSGameRules()->HasRoundInfinite(SCENARIO_BLOCK_BOMB)) { if (HasRoundInfinite(SCENARIO_BLOCK_BOMB)) {
me->GetGameState()->Reset(); me->GetGameState()->Reset();
me->Hunt(); me->Hunt();
return; return;

@ -26,7 +26,7 @@ DLL_FUNCTIONS gFunctionTable =
&ClientDisconnect, &ClientDisconnect,
&ClientKill, &ClientKill,
&ClientPutInServer, &ClientPutInServer,
&ClientCommand, &ClientCommand_,
&ClientUserInfoChanged, &ClientUserInfoChanged,
&ServerActivate, &ServerActivate,
&ServerDeactivate, &ServerDeactivate,

@ -85,8 +85,6 @@
#define CLASS_VEHICLE 14 #define CLASS_VEHICLE 14
#define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures. #define CLASS_BARNACLE 99 // special because no one pays attention to it, and it eats a wide cross-section of creatures.
#define GIB_HEALTH_VALUE -30
#define ROUTE_SIZE 8 #define ROUTE_SIZE 8
#define MAX_OLD_ENEMIES 4 #define MAX_OLD_ENEMIES 4
@ -183,6 +181,7 @@
#define GIB_NORMAL 0 // gib if entity was overkilled #define GIB_NORMAL 0 // gib if entity was overkilled
#define GIB_NEVER 1 // never gib, no matter how much death damage is done ( freezing, etc ) #define GIB_NEVER 1 // never gib, no matter how much death damage is done ( freezing, etc )
#define GIB_ALWAYS 2 // always gib ( Houndeye Shock, Barnacle Bite ) #define GIB_ALWAYS 2 // always gib ( Houndeye Shock, Barnacle Bite )
#define GIB_HEALTH_VALUE -30
#define SF_ITEM_USE_ONLY 256 #define SF_ITEM_USE_ONLY 256

@ -152,7 +152,6 @@ void respawn(entvars_t *pev, BOOL fCopyCorpse)
CSGameRules()->MarkSpawnSkipped(); CSGameRules()->MarkSpawnSkipped();
CBasePlayer *pPlayer = GetClassPtr<CCSPlayer>((CBasePlayer *)pev); CBasePlayer *pPlayer = GetClassPtr<CCSPlayer>((CBasePlayer *)pev);
if (CSGameRules()->IsCareer() && CSGameRules()->ShouldSkipSpawn() && pPlayer->IsAlive()) if (CSGameRules()->IsCareer() && CSGameRules()->ShouldSkipSpawn() && pPlayer->IsAlive())
g_skipCareerInitialSpawn = true; g_skipCareerInitialSpawn = true;
@ -215,7 +214,7 @@ void EXT_FUNC __API_HOOK(ShowVGUIMenu)(CBasePlayer *pPlayer, int MenuType, int B
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (CSGameRules()->ShouldSkipShowMenu()) { if (CSGameRules()->ShouldSkipShowMenu()) {
CSGameRules()->MarkShowMenuSkipped(); CSGameRules()->MarkShowMenuSkipped();
pPlayer->m_iMenu = Menu_OFF; pPlayer->ResetMenu();
return; return;
} }
@ -1453,14 +1452,20 @@ void EXT_FUNC __API_HOOK(HandleMenu_ChooseAppearance)(CBasePlayer *player, int s
appearance.model_name_index = 9; appearance.model_name_index = 9;
} }
#ifdef REGAMEDLL_FIXES
player->ResetMenu();
#else
player->m_iMenu = Menu_OFF; player->m_iMenu = Menu_OFF;
#endif
// Reset the player's state // Reset the player's state
if (player->m_iJoiningState == JOINED) switch (player->m_iJoiningState)
{ {
case JOINED:
CSGameRules()->CheckWinConditions(); CSGameRules()->CheckWinConditions();
} break;
else if (player->m_iJoiningState == PICKINGTEAM)
case PICKINGTEAM:
{ {
player->m_iJoiningState = GETINTOGAME; player->m_iJoiningState = GETINTOGAME;
@ -1471,6 +1476,8 @@ void EXT_FUNC __API_HOOK(HandleMenu_ChooseAppearance)(CBasePlayer *player, int s
CSGameRules()->CheckWinConditions(); CSGameRules()->CheckWinConditions();
} }
} }
break;
}
} }
player->pev->body = 0; player->pev->body = 0;
@ -1713,7 +1720,6 @@ BOOL EXT_FUNC __API_HOOK(HandleMenu_ChooseTeam)(CBasePlayer *player, int slot)
) )
{ {
int humanTeam = UNASSIGNED; int humanTeam = UNASSIGNED;
if (!Q_stricmp(humans_join_team.string, "CT")) if (!Q_stricmp(humans_join_team.string, "CT"))
{ {
humanTeam = CT; humanTeam = CT;
@ -1763,11 +1769,9 @@ BOOL EXT_FUNC __API_HOOK(HandleMenu_ChooseTeam)(CBasePlayer *player, int slot)
player->pev->solid = SOLID_NOT; player->pev->solid = SOLID_NOT;
player->pev->movetype = MOVETYPE_NOCLIP; player->pev->movetype = MOVETYPE_NOCLIP;
player->pev->effects = EF_NODRAW; player->pev->effects = (EF_NODRAW | EF_NOINTERP);
player->pev->effects |= EF_NOINTERP;
player->pev->takedamage = DAMAGE_NO; player->pev->takedamage = DAMAGE_NO;
player->pev->deadflag = DEAD_DEAD; player->pev->deadflag = DEAD_DEAD;
player->pev->velocity = g_vecZero;
player->pev->punchangle = g_vecZero; player->pev->punchangle = g_vecZero;
player->m_bHasNightVision = false; player->m_bHasNightVision = false;
@ -1775,10 +1779,18 @@ BOOL EXT_FUNC __API_HOOK(HandleMenu_ChooseTeam)(CBasePlayer *player, int slot)
player->m_fDeadTime = 0; player->m_fDeadTime = 0;
player->has_disconnected = false; player->has_disconnected = false;
#ifdef REGAMEDLL_ADD
player->m_iJoiningState = PICKINGTEAM;
#else
player->pev->velocity = g_vecZero;
player->m_iJoiningState = GETINTOGAME; player->m_iJoiningState = GETINTOGAME;
#endif
player->SendItemStatus(); player->SendItemStatus();
#ifndef REGAMEDLL_ADD
SET_CLIENT_MAXSPEED(ENT(player->pev), 1); SET_CLIENT_MAXSPEED(ENT(player->pev), 1);
#endif
SET_MODEL(ENT(player->pev), "models/player.mdl"); SET_MODEL(ENT(player->pev), "models/player.mdl");
} }
@ -2286,25 +2298,9 @@ BOOL HandleRadioAliasCommands(CBasePlayer *pPlayer, const char *pszCommand)
return FALSE; return FALSE;
} }
bool EXT_FUNC InternalCommand(edict_t *pEntity, const char *cmd) { void EXT_FUNC InternalCommand(edict_t *pEntity, const char *pcmd, const char *parg1)
return true;
}
// Use CMD_ARGV, CMD_ARGV, and CMD_ARGC to get pointers the character string command.
void EXT_FUNC ClientCommand(edict_t *pEntity)
{ {
const char *pcmd = CMD_ARGV_(0);
const char *pstr = NULL; const char *pstr = NULL;
// Is the client spawned yet?
if (!pEntity->pvPrivateData)
return;
#ifdef REGAMEDLL_API
if (!g_ReGameHookchains.m_InternalCommand.callChain(InternalCommand, pEntity, pcmd))
return;
#endif
entvars_t *pev = &pEntity->v; entvars_t *pev = &pEntity->v;
CBasePlayer *player = GetClassPtr<CCSPlayer>((CBasePlayer *)pev); CBasePlayer *player = GetClassPtr<CCSPlayer>((CBasePlayer *)pev);
@ -2351,15 +2347,14 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
int iVoteID; int iVoteID;
int iVoteFail = 0; int iVoteFail = 0;
int iNumArgs = CMD_ARGC_(); int iNumArgs = CMD_ARGC_();
const char *pszArg1 = CMD_ARGV_(1); int iVoteLength = Q_strlen(parg1);
int iVoteLength = Q_strlen(pszArg1);
if (iNumArgs != 2 || iVoteLength <= 0 || iVoteLength > 6) if (iNumArgs != 2 || iVoteLength <= 0 || iVoteLength > 6)
{ {
iVoteFail = 1; iVoteFail = 1;
} }
iVoteID = Q_atoi(pszArg1); iVoteID = Q_atoi(parg1);
if (iVoteID <= 0) if (iVoteID <= 0)
{ {
iVoteFail = 1; iVoteFail = 1;
@ -2439,15 +2434,14 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
int iFailed = 0; int iFailed = 0;
int iNumArgs = CMD_ARGC_(); int iNumArgs = CMD_ARGC_();
const char *pszArg1 = CMD_ARGV_(1); int iVoteLength = Q_strlen(parg1);
int iVoteLength = Q_strlen(pszArg1);
if (iNumArgs != 2 || iVoteLength > 5) if (iNumArgs != 2 || iVoteLength > 5)
{ {
iFailed = 1; iFailed = 1;
} }
int iVoteID = Q_atoi(pszArg1); int iVoteID = Q_atoi(parg1);
if (iVoteID < 1 || iVoteID > MAX_VOTE_MAPS) if (iVoteID < 1 || iVoteID > MAX_VOTE_MAPS)
{ {
iFailed = 1; iFailed = 1;
@ -2560,7 +2554,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
} }
else if (FStrEq(pcmd, "menuselect")) else if (FStrEq(pcmd, "menuselect"))
{ {
int slot = Q_atoi(CMD_ARGV_(1)); int slot = Q_atoi(parg1);
if (player->m_iJoiningState == JOINED || (player->m_iMenu != Menu_ChooseAppearance && player->m_iMenu != Menu_ChooseTeam)) if (player->m_iJoiningState == JOINED || (player->m_iMenu != Menu_ChooseAppearance && player->m_iMenu != Menu_ChooseTeam))
{ {
if (slot == 10) if (slot == 10)
@ -2901,8 +2895,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
else if (FStrEq(pcmd, "specmode")) else if (FStrEq(pcmd, "specmode"))
{ {
// new spectator mode // new spectator mode
int mode = Q_atoi(CMD_ARGV_(1)); int mode = Q_atoi(parg1);
if (player->IsObserver() && player->CanSwitchObserverModes()) if (player->IsObserver() && player->CanSwitchObserverModes())
player->Observer_SetMode(mode); player->Observer_SetMode(mode);
else else
@ -2916,14 +2909,13 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
} }
else if (FStrEq(pcmd, "spec_set_ad")) else if (FStrEq(pcmd, "spec_set_ad"))
{ {
float val = Q_atof(CMD_ARGV_(1)); float val = Q_atof(parg1);
player->SetObserverAutoDirector(val > 0.0f); player->SetObserverAutoDirector(val > 0.0f);
} }
else if (FStrEq(pcmd, "follownext")) else if (FStrEq(pcmd, "follownext"))
{ {
// follow next player // follow next player
int arg = Q_atoi(CMD_ARGV_(1)); int arg = Q_atoi(parg1);
if (player->IsObserver() && player->CanSwitchObserverModes()) if (player->IsObserver() && player->CanSwitchObserverModes())
{ {
player->Observer_FindNextPlayer(arg != 0); player->Observer_FindNextPlayer(arg != 0);
@ -2933,7 +2925,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
{ {
if (player->IsObserver() && player->CanSwitchObserverModes()) if (player->IsObserver() && player->CanSwitchObserverModes())
{ {
player->Observer_FindNextPlayer(false, CMD_ARGV_(1)); player->Observer_FindNextPlayer(false, parg1);
} }
} }
else else
@ -2949,7 +2941,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
if (FStrEq(pcmd, "mp_debug")) if (FStrEq(pcmd, "mp_debug"))
{ {
UTIL_SetDprintfFlags(CMD_ARGV_(1)); UTIL_SetDprintfFlags(parg1);
} }
else if (FStrEq(pcmd, "jointeam")) else if (FStrEq(pcmd, "jointeam"))
{ {
@ -2959,12 +2951,16 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
return; return;
} }
int slot = Q_atoi(CMD_ARGV_(1)); int slot = Q_atoi(parg1);
if (HandleMenu_ChooseTeam(player, slot)) if (HandleMenu_ChooseTeam(player, slot))
{ {
if (slot == MENU_SLOT_TEAM_VIP || slot == MENU_SLOT_TEAM_SPECT || player->m_bIsVIP) if (slot == MENU_SLOT_TEAM_VIP || slot == MENU_SLOT_TEAM_SPECT || player->m_bIsVIP)
{ {
#ifdef REGAMEDLL_FIXES
player->ResetMenu();
#else
player->m_iMenu = Menu_OFF; player->m_iMenu = Menu_OFF;
#endif
} }
else else
player->m_iMenu = Menu_ChooseAppearance; player->m_iMenu = Menu_ChooseAppearance;
@ -2980,8 +2976,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
} }
else if (FStrEq(pcmd, "joinclass")) else if (FStrEq(pcmd, "joinclass"))
{ {
int slot = Q_atoi(CMD_ARGV_(1)); int slot = Q_atoi(parg1);
if (player->m_iMenu != Menu_ChooseAppearance) if (player->m_iMenu != Menu_ChooseAppearance)
{ {
ClientPrint(player->pev, HUD_PRINTCENTER, "#Command_Not_Available"); ClientPrint(player->pev, HUD_PRINTCENTER, "#Command_Not_Available");
@ -3082,7 +3077,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
player->DropShield(); player->DropShield();
} }
else else
player->DropPlayerItem(CMD_ARGV_(1)); player->DropPlayerItem(parg1);
} }
else if (FStrEq(pcmd, "fov")) else if (FStrEq(pcmd, "fov"))
{ {
@ -3095,7 +3090,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
} }
else if (FStrEq(pcmd, "use")) else if (FStrEq(pcmd, "use"))
{ {
GetClassPtr<CCSPlayer>((CBasePlayer *)pev)->SelectItem(CMD_ARGV_(1)); GetClassPtr<CCSPlayer>((CBasePlayer *)pev)->SelectItem(parg1);
} }
else if (((pstr = Q_strstr(pcmd, "weapon_"))) && (pstr == pcmd)) else if (((pstr = Q_strstr(pcmd, "weapon_"))) && (pstr == pcmd))
{ {
@ -3184,7 +3179,7 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
{ {
if (CMD_ARGC_() == 2) if (CMD_ARGC_() == 2)
{ {
player->InitRebuyData(CMD_ARGV_(1)); player->InitRebuyData(parg1);
bool oldval = g_bClientPrintEnable; bool oldval = g_bClientPrintEnable;
g_bClientPrintEnable = false; g_bClientPrintEnable = false;
@ -3242,6 +3237,19 @@ void EXT_FUNC ClientCommand(edict_t *pEntity)
} }
} }
// Use CMD_ARGV, CMD_ARGV, and CMD_ARGC to get pointers the character string command.
void EXT_FUNC ClientCommand_(edict_t *pEntity)
{
const char *pcmd = CMD_ARGV_(0);
const char *parg1 = CMD_ARGV_(1);
// Is the client spawned yet?
if (!pEntity->pvPrivateData)
return;
g_ReGameHookchains.m_InternalCommand.callChain(InternalCommand, pEntity, pcmd, parg1);
}
// called after the player changes userinfo - gives dll a chance to modify it before it gets sent into the rest of the engine. // called after the player changes userinfo - gives dll a chance to modify it before it gets sent into the rest of the engine.
void EXT_FUNC ClientUserInfoChanged(edict_t *pEntity, char *infobuffer) void EXT_FUNC ClientUserInfoChanged(edict_t *pEntity, char *infobuffer)
{ {

@ -153,7 +153,7 @@ CBaseEntity *EntityFromUserID(int userID);
int CountPlayersInServer(); int CountPlayersInServer();
BOOL HandleBuyAliasCommands(CBasePlayer *pPlayer, const char *pszCommand); BOOL HandleBuyAliasCommands(CBasePlayer *pPlayer, const char *pszCommand);
BOOL HandleRadioAliasCommands(CBasePlayer *pPlayer, const char *pszCommand); BOOL HandleRadioAliasCommands(CBasePlayer *pPlayer, const char *pszCommand);
void ClientCommand(edict_t *pEntity); void ClientCommand_(edict_t *pEntity);
void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer); void ClientUserInfoChanged(edict_t *pEntity, char *infobuffer);
void ServerDeactivate(); void ServerDeactivate();
void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax); void ServerActivate(edict_t *pEdictList, int edictCount, int clientMax);
@ -197,14 +197,10 @@ inline const char *GetTeamName(int team)
{ {
switch (team) switch (team)
{ {
case CT: case CT: return "CT";
return "CT"; case TERRORIST: return "TERRORIST";
case TERRORIST: case SPECTATOR: return "SPECTATOR";
return "TERRORIST"; default: return "UNASSIGNED";
case SPECTATOR:
return "SPECTATOR";
default:
return "UNASSIGNED";
} }
} }

@ -1973,8 +1973,14 @@ void CItemSoda::CanTouch(CBaseEntity *pOther)
return; return;
#endif #endif
#ifdef REGAMEDLL_FIXES
// spoit sound here // spoit sound here
pPlayer->TakeHealth(1, DMG_GENERIC); // a bit of health. // if we can't take hp, go out
if (!pPlayer->TakeHealth(1, DMG_GENERIC)) // a bit of health.
return;
#else
pPlayer->TakeHealth(1, DMG_GENERIC);
#endif
if (!FNullEnt(pev->owner)) if (!FNullEnt(pev->owner))
{ {

@ -381,7 +381,7 @@ void CBreakable::__MAKE_VHOOK(Precache)()
pGibName = STRING(m_iszGibModel); pGibName = STRING(m_iszGibModel);
} }
if (pGibName != NULL) if (pGibName)
{ {
m_idShard = PRECACHE_MODEL((char *)pGibName); m_idShard = PRECACHE_MODEL((char *)pGibName);
} }
@ -693,7 +693,7 @@ void CBreakable::Die()
} }
cFlag = BREAK_GLASS; cFlag = BREAK_GLASS;
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_BREAK_GLASS, this); TheBots->OnEvent(EVENT_BREAK_GLASS, this);
} }
@ -708,7 +708,7 @@ void CBreakable::Die()
} }
cFlag = BREAK_WOOD; cFlag = BREAK_WOOD;
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_BREAK_WOOD, this); TheBots->OnEvent(EVENT_BREAK_WOOD, this);
} }
@ -725,7 +725,7 @@ void CBreakable::Die()
} }
cFlag = BREAK_METAL; cFlag = BREAK_METAL;
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_BREAK_METAL, this); TheBots->OnEvent(EVENT_BREAK_METAL, this);
} }
@ -741,7 +741,7 @@ void CBreakable::Die()
} }
cFlag = BREAK_FLESH; cFlag = BREAK_FLESH;
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_BREAK_FLESH, this); TheBots->OnEvent(EVENT_BREAK_FLESH, this);
} }
@ -758,7 +758,7 @@ void CBreakable::Die()
} }
cFlag = BREAK_CONCRETE; cFlag = BREAK_CONCRETE;
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_BREAK_CONCRETE, this); TheBots->OnEvent(EVENT_BREAK_CONCRETE, this);
} }

@ -767,7 +767,6 @@ public:
// has a style of gameplay when aren't any teams // has a style of gameplay when aren't any teams
bool IsFreeForAll() const; bool IsFreeForAll() const;
bool HasRoundInfinite(int flags = 0) const;
VFUNC bool HasRoundTimeExpired(); VFUNC bool HasRoundTimeExpired();
VFUNC bool IsBombPlanted(); VFUNC bool IsBombPlanted();
@ -946,7 +945,7 @@ inline bool CHalfLifeMultiplay::IsFreeForAll() const
return false; return false;
} }
inline bool CHalfLifeMultiplay::HasRoundInfinite(int flags) const inline bool HasRoundInfinite(int flags = 0)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (round_infinite.string[0] == '1') if (round_infinite.string[0] == '1')
@ -967,7 +966,7 @@ void SV_Career_EndRound_f();
void SV_CareerAddTask_f(); void SV_CareerAddTask_f();
void SV_CareerMatchLimit_f(); void SV_CareerMatchLimit_f();
void Broadcast(const char *sentence); void Broadcast(const char *sentence);
char *GetTeam(int teamNo); char *GetTeam(int team);
void EndRoundMessage(const char *sentence, int event); void EndRoundMessage(const char *sentence, int event);
void DestroyMapCycle(mapcycle_t *cycle); void DestroyMapCycle(mapcycle_t *cycle);

@ -580,32 +580,33 @@ void CHostage::TraceAttack(entvars_t *pevAttacker, float flDamage, Vector vecDir
BOOL CHostage::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) BOOL CHostage::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType)
{ {
float flActualDamage; #ifdef REGAMEDLL_ADD
CBasePlayer *pAttacker = NULL; if (hostagehurtable.value <= 0)
return FALSE;
#endif
flActualDamage = GetModifiedDamage(flDamage, m_LastHitGroup); float flActualDamage = GetModifiedDamage(flDamage, m_LastHitGroup);
if (flActualDamage > pev->health) if (flActualDamage > pev->health)
flActualDamage = pev->health; flActualDamage = pev->health;
pev->health -= flActualDamage; pev->health -= flActualDamage;
if (m_improv != NULL) if (m_improv)
{ {
m_improv->OnInjury(flActualDamage); m_improv->OnInjury(flActualDamage);
} }
PlayPainSound(); PlayPainSound();
if (pevAttacker != NULL) CBasePlayer *pAttacker = NULL;
if (pevAttacker)
{ {
CBaseEntity *pAttackingEnt = GetClassPtr<CCSEntity>((CBaseEntity *)pevAttacker); CBaseEntity *pAttackingEnt = GetClassPtr<CCSEntity>((CBaseEntity *)pevAttacker);
if (pAttackingEnt->Classify() == CLASS_VEHICLE) if (pAttackingEnt->Classify() == CLASS_VEHICLE)
{ {
CBaseEntity *pDriver = ((CFuncVehicle *)pAttackingEnt)->m_pDriver; CBaseEntity *pDriver = ((CFuncVehicle *)pAttackingEnt)->m_pDriver;
if (pDriver)
if (pDriver != NULL)
{ {
pevAttacker = pDriver->pev; pevAttacker = pDriver->pev;
} }
@ -622,11 +623,11 @@ BOOL CHostage::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevA
m_flFlinchTime = gpGlobals->time + 0.75f; m_flFlinchTime = gpGlobals->time + 0.75f;
SetFlinchActivity(); SetFlinchActivity();
if (pAttacker != NULL) if (pAttacker)
{ {
pAttacker->AddAccount(-20 * int(flActualDamage), RT_HOSTAGE_DAMAGED); pAttacker->AddAccount(-20 * int(flActualDamage), RT_HOSTAGE_DAMAGED);
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_HOSTAGE_DAMAGED, this, pAttacker); TheBots->OnEvent(EVENT_HOSTAGE_DAMAGED, this, pAttacker);
} }
@ -659,12 +660,12 @@ BOOL CHostage::__MAKE_VHOOK(TakeDamage)(entvars_t *pevInflictor, entvars_t *pevA
pev->deadflag = DEAD_DEAD; pev->deadflag = DEAD_DEAD;
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
if (TheBots != NULL) if (TheBots)
{ {
TheBots->OnEvent(EVENT_HOSTAGE_KILLED, this, pAttacker); TheBots->OnEvent(EVENT_HOSTAGE_KILLED, this, pAttacker);
} }
if (m_improv != NULL) if (m_improv)
{ {
m_improv->Chatter(HOSTAGE_CHATTER_DEATH_CRY); m_improv->Chatter(HOSTAGE_CHATTER_DEATH_CRY);
} }

@ -79,7 +79,7 @@ void CWorldItem::__MAKE_VHOOK(Spawn)()
break; break;
} }
if (pEntity != NULL) if (pEntity)
{ {
pEntity->pev->target = pev->target; pEntity->pev->target = pev->target;
pEntity->pev->targetname = pev->targetname; pEntity->pev->targetname = pev->targetname;
@ -369,7 +369,7 @@ BOOL CItemKevlar::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
WRITE_BYTE(0); WRITE_BYTE(0);
MESSAGE_END(); MESSAGE_END();
if (TheTutor != NULL) if (TheTutor)
{ {
TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer); TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer);
} }
@ -411,7 +411,7 @@ BOOL CItemAssaultSuit::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
WRITE_BYTE(1); WRITE_BYTE(1);
MESSAGE_END(); MESSAGE_END();
if (TheTutor != NULL) if (TheTutor)
{ {
TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer); TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer);
} }
@ -459,7 +459,7 @@ BOOL CItemThighPack::__MAKE_VHOOK(MyTouch)(CBasePlayer *pPlayer)
pPlayer->SendItemStatus(); pPlayer->SendItemStatus();
EMIT_SOUND(pPlayer->edict(), CHAN_VOICE, "items/kevlar.wav", VOL_NORM, ATTN_NORM); EMIT_SOUND(pPlayer->edict(), CHAN_VOICE, "items/kevlar.wav", VOL_NORM, ATTN_NORM);
if (TheTutor != NULL) if (TheTutor)
{ {
TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer); TheTutor->OnEvent(EVENT_PLAYER_BOUGHT_SOMETHING, pPlayer);
} }

@ -239,29 +239,28 @@ void Broadcast(const char *sentence)
MESSAGE_END(); MESSAGE_END();
} }
char *GetTeam(int teamNo) char *GetTeam(int team)
{ {
switch (teamNo) switch (team)
{ {
case TERRORIST: case CT: return "CT";
return "TERRORIST"; case TERRORIST: return "TERRORIST";
case CT: case SPECTATOR: return "SPECTATOR";
return "CT"; default: return "";
case SPECTATOR:
return "SPECTATOR";
default:
break;
} }
return "";
} }
void CHalfLifeMultiplay::EndRoundMessage(const char *sentence, int event) void CHalfLifeMultiplay::EndRoundMessage(const char *sentence, int event)
{ {
char *team = NULL; char *team = NULL;
const char *message = &(sentence[1]); const char *message = sentence;
bool bTeamTriggered = true; bool bTeamTriggered = true;
if (sentence[0] == '#')
message = sentence + 1;
if (sentence[0])
{
UTIL_ClientPrintAll(HUD_PRINTCENTER, sentence); UTIL_ClientPrintAll(HUD_PRINTCENTER, sentence);
switch (event) switch (event)
@ -312,6 +311,7 @@ void CHalfLifeMultiplay::EndRoundMessage(const char *sentence, int event)
{ {
UTIL_LogPrintf("World triggered \"%s\" (CT \"%i\") (T \"%i\")\n", message, m_iNumCTWins, m_iNumTerroristWins); UTIL_LogPrintf("World triggered \"%s\" (CT \"%i\") (T \"%i\")\n", message, m_iNumCTWins, m_iNumTerroristWins);
} }
}
UTIL_LogPrintf("World triggered \"Round_End\"\n"); UTIL_LogPrintf("World triggered \"Round_End\"\n");
} }
@ -1681,9 +1681,12 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
g_pHostages->RestartRound(); g_pHostages->RestartRound();
} }
#ifndef REGAMEDLL_FIXES #ifdef REGAMEDLL_FIXES
++m_iTotalRoundsPlayed; if (!m_bCompleteReset)
#endif #endif
{
++m_iTotalRoundsPlayed;
}
ClearBodyQue(); ClearBodyQue();
@ -1752,7 +1755,7 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
UTIL_ClientPrintAll(HUD_PRINTCENTER, "#Auto_Team_Balance_Next_Round"); UTIL_ClientPrintAll(HUD_PRINTCENTER, "#Auto_Team_Balance_Next_Round");
} }
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
else if (autoteambalance.value > 1 && m_iUnBalancedRounds >= 1) else if (autoteambalance.value >= 2 && m_iUnBalancedRounds >= 1)
{ {
BalanceTeams(); BalanceTeams();
} }
@ -1813,12 +1816,6 @@ void EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(RestartRound)()
TheBots->OnEvent(EVENT_NEW_MATCH); TheBots->OnEvent(EVENT_NEW_MATCH);
} }
} }
#ifdef REGAMEDLL_FIXES
else
{
m_iTotalRoundsPlayed++;
}
#endif
m_bFreezePeriod = TRUE; m_bFreezePeriod = TRUE;
m_bRoundTerminating = false; m_bRoundTerminating = false;
@ -3638,20 +3635,19 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerThink)(CBasePlayer *pPlayer)
if (pPlayer->m_iMenu != Menu_ChooseTeam && pPlayer->m_iJoiningState == SHOWTEAMSELECT) if (pPlayer->m_iMenu != Menu_ChooseTeam && pPlayer->m_iJoiningState == SHOWTEAMSELECT)
{ {
int team = MENU_SLOT_TEAM_UNDEFINED; int slot = MENU_SLOT_TEAM_UNDEFINED;
if (!Q_stricmp(humans_join_team.string, "T")) if (!Q_stricmp(humans_join_team.string, "T"))
{ {
team = MENU_SLOT_TEAM_TERRORIST; slot = MENU_SLOT_TEAM_TERRORIST;
} }
else if (!Q_stricmp(humans_join_team.string, "CT")) else if (!Q_stricmp(humans_join_team.string, "CT"))
{ {
team = MENU_SLOT_TEAM_CT; slot = MENU_SLOT_TEAM_CT;
} }
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
else if (!Q_stricmp(humans_join_team.string, "any") && auto_join_team.value != 0.0f) else if (!Q_stricmp(humans_join_team.string, "any") && auto_join_team.value != 0.0f)
{ {
team = MENU_SLOT_TEAM_RANDOM; slot = MENU_SLOT_TEAM_RANDOM;
} }
#endif #endif
else else
@ -3665,22 +3661,33 @@ void CHalfLifeMultiplay::__MAKE_VHOOK(PlayerThink)(CBasePlayer *pPlayer)
pPlayer->m_iMenu = Menu_ChooseTeam; pPlayer->m_iMenu = Menu_ChooseTeam;
pPlayer->m_iJoiningState = PICKINGTEAM; pPlayer->m_iJoiningState = PICKINGTEAM;
if (team != MENU_SLOT_TEAM_UNDEFINED && !pPlayer->IsBot()) if (slot != MENU_SLOT_TEAM_UNDEFINED && !pPlayer->IsBot())
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
m_bSkipShowMenu = (auto_join_team.value != 0.0f); m_bSkipShowMenu = (auto_join_team.value != 0.0f) && !(pPlayer->pev->flags & FL_FAKECLIENT);
HandleMenu_ChooseTeam(pPlayer, team);
if (team != MENU_SLOT_TEAM_SPECT && (IsCareer() || m_bSkipShowMenu)) if (HandleMenu_ChooseTeam(pPlayer, slot))
{
if (slot != MENU_SLOT_TEAM_SPECT && (IsCareer() || m_bSkipShowMenu))
{ {
// slot 6 - chooses randomize the appearance to model player // slot 6 - chooses randomize the appearance to model player
HandleMenu_ChooseAppearance(pPlayer, 6); HandleMenu_ChooseAppearance(pPlayer, 6);
} }
}
else
{
m_bSkipShowMenu = false;
if (allow_spectators.value == 0.0f)
ShowVGUIMenu(pPlayer, VGUI_Menu_Team, (MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_5), "#Team_Select");
else
ShowVGUIMenu(pPlayer, VGUI_Menu_Team, (MENU_KEY_1 | MENU_KEY_2 | MENU_KEY_5 | MENU_KEY_6), "#Team_Select_Spect");
}
m_bSkipShowMenu = false; m_bSkipShowMenu = false;
#else #else
HandleMenu_ChooseTeam(pPlayer, team); HandleMenu_ChooseTeam(pPlayer, slot);
if (team != MENU_SLOT_TEAM_SPECT && IsCareer()) if (slot != MENU_SLOT_TEAM_SPECT && IsCareer())
{ {
// slot 6 - chooses randomize the appearance to model player // slot 6 - chooses randomize the appearance to model player
HandleMenu_ChooseAppearance(pPlayer, 6); HandleMenu_ChooseAppearance(pPlayer, 6);
@ -3709,10 +3716,9 @@ LINK_HOOK_CLASS_CUSTOM_CHAIN(BOOL, CHalfLifeMultiplay, CSGameRules, FPlayerCanRe
BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanRespawn)(CBasePlayer *pPlayer) BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanRespawn)(CBasePlayer *pPlayer)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
if (forcerespawn.value) if (forcerespawn.value <= 0)
return TRUE;
#endif #endif
{
// Player cannot respawn twice in a round // Player cannot respawn twice in a round
if (pPlayer->m_iNumSpawns > 0) if (pPlayer->m_iNumSpawns > 0)
{ {
@ -3751,6 +3757,7 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanRespawn)(CBasePlayer *pP
} }
} }
} }
}
// Player cannot respawn while in the Choose Appearance menu // Player cannot respawn while in the Choose Appearance menu
if (pPlayer->m_iMenu == Menu_ChooseAppearance) if (pPlayer->m_iMenu == Menu_ChooseAppearance)
@ -3763,7 +3770,7 @@ BOOL EXT_FUNC CHalfLifeMultiplay::__API_VHOOK(FPlayerCanRespawn)(CBasePlayer *pP
float CHalfLifeMultiplay::__MAKE_VHOOK(FlPlayerSpawnTime)(CBasePlayer *pPlayer) float CHalfLifeMultiplay::__MAKE_VHOOK(FlPlayerSpawnTime)(CBasePlayer *pPlayer)
{ {
return gpGlobals->time;//now! return gpGlobals->time;
} }
BOOL CHalfLifeMultiplay::__MAKE_VHOOK(AllowAutoTargetCrosshair)() BOOL CHalfLifeMultiplay::__MAKE_VHOOK(AllowAutoTargetCrosshair)()

@ -504,3 +504,10 @@ void CBasePlayer::Observer_SetMode(int iMode)
m_iObserverLastMode = iMode; m_iObserverLastMode = iMode;
m_bWasFollowing = false; m_bWasFollowing = false;
} }
void CBasePlayer::Observer_Think()
{
Observer_HandleButtons();
Observer_CheckTarget();
Observer_CheckProperties();
}

@ -1013,8 +1013,7 @@ BOOL EXT_FUNC CBasePlayer::__API_VHOOK(TakeDamage)(entvars_t *pevInflictor, entv
if (bitsDamageType & DMG_EXPLOSION) if (bitsDamageType & DMG_EXPLOSION)
{ {
CBaseEntity *temp = GetClassPtr<CCSEntity>((CBaseEntity *)pevInflictor); CBaseEntity *temp = GetClassPtr<CCSEntity>((CBaseEntity *)pevInflictor);
if (FClassnameIs(temp->pev, "grenade"))
if (!Q_strcmp(STRING(temp->pev->classname), "grenade"))
{ {
CGrenade *pGrenade = GetClassPtr<CCSGrenade>((CGrenade *)pevInflictor); CGrenade *pGrenade = GetClassPtr<CCSGrenade>((CGrenade *)pevInflictor);
@ -1161,7 +1160,7 @@ BOOL EXT_FUNC CBasePlayer::__API_VHOOK(TakeDamage)(entvars_t *pevInflictor, entv
pAttacker = CBaseEntity::Instance(pevAttacker); pAttacker = CBaseEntity::Instance(pevAttacker);
if (!g_pGameRules->FPlayerCanTakeDamage(this, pAttacker) && Q_strcmp("grenade", STRING(pevInflictor->classname)) != 0) if (!g_pGameRules->FPlayerCanTakeDamage(this, pAttacker) && !FClassnameIs(pevInflictor, "grenade"))
{ {
// Refuse the damage // Refuse the damage
return FALSE; return FALSE;
@ -2278,6 +2277,10 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(Killed)(entvars_t *pevAttacker, int iGib)
m_bIsDefusing = false; m_bIsDefusing = false;
BuyZoneIcon_Clear(this); BuyZoneIcon_Clear(this);
#ifdef REGAMEDLL_ADD
CSPlayer()->m_flRespawnPending = gpGlobals->time;
#endif
SetThink(&CBasePlayer::PlayerDeathThink); SetThink(&CBasePlayer::PlayerDeathThink);
pev->nextthink = gpGlobals->time + 0.1f; pev->nextthink = gpGlobals->time + 0.1f;
pev->solid = SOLID_NOT; pev->solid = SOLID_NOT;
@ -2374,7 +2377,9 @@ void EXT_FUNC CBasePlayer::__API_HOOK(SetAnimation)(PLAYER_ANIM playerAnim)
case PLAYER_DIE: case PLAYER_DIE:
{ {
m_IdealActivity = ACT_DIESIMPLE; m_IdealActivity = ACT_DIESIMPLE;
#ifndef REGAMEDLL_FIXES
DeathSound(); DeathSound();
#endif
break; break;
} }
case PLAYER_ATTACK1: case PLAYER_ATTACK1:
@ -3265,17 +3270,16 @@ void EXT_FUNC CBasePlayer::__API_HOOK(AddAccount)(int amount, RewardType type, b
void CBasePlayer::ResetMenu() void CBasePlayer::ResetMenu()
{ {
#ifdef REGAMEDLL_FIXES
m_iMenu = Menu_OFF;
#endif
MESSAGE_BEGIN(MSG_ONE, gmsgShowMenu, NULL, pev); MESSAGE_BEGIN(MSG_ONE, gmsgShowMenu, NULL, pev);
WRITE_SHORT(0); WRITE_SHORT(0);
WRITE_CHAR(0); WRITE_CHAR(0);
WRITE_BYTE(0); WRITE_BYTE(0);
WRITE_STRING(""); WRITE_STRING("");
MESSAGE_END(); MESSAGE_END();
#ifdef REGAMEDLL_FIXES
m_iMenu = Menu_OFF;
#endif
} }
void CBasePlayer::SyncRoundTimer() void CBasePlayer::SyncRoundTimer()
@ -3586,7 +3590,6 @@ void CBasePlayer::PlayerDeathThink()
if (pev->flags & FL_ONGROUND) if (pev->flags & FL_ONGROUND)
{ {
float flForward = pev->velocity.Length() - 20; float flForward = pev->velocity.Length() - 20;
if (flForward <= 0) if (flForward <= 0)
pev->velocity = g_vecZero; pev->velocity = g_vecZero;
else else
@ -3632,9 +3635,7 @@ void CBasePlayer::PlayerDeathThink()
{ {
// if the player has been dead for one second longer than allowed by forcerespawn, // if the player has been dead for one second longer than allowed by forcerespawn,
// forcerespawn isn't on. Send the player off to an intermission camera until they choose to respawn. // forcerespawn isn't on. Send the player off to an intermission camera until they choose to respawn.
if (g_pGameRules->IsMultiplayer()) if (g_pGameRules->IsMultiplayer() && gpGlobals->time > m_fDeadTime + 3 && !(m_afPhysicsFlags & PFLAG_OBSERVER))
{
if (gpGlobals->time > m_fDeadTime + 3.0f && !(m_afPhysicsFlags & PFLAG_OBSERVER))
{ {
// Send message to everybody to spawn a corpse. // Send message to everybody to spawn a corpse.
SpawnClientSideCorpse(); SpawnClientSideCorpse();
@ -3643,24 +3644,22 @@ void CBasePlayer::PlayerDeathThink()
StartDeathCam(); StartDeathCam();
} }
} }
}
// wait for all buttons released // wait for all buttons released
if (pev->deadflag == DEAD_DEAD && m_iTeam != UNASSIGNED && m_iTeam != SPECTATOR) if (pev->deadflag == DEAD_DEAD && m_iTeam != UNASSIGNED && m_iTeam != SPECTATOR)
{ {
#ifdef REGAMEDLL_ADD #ifdef REGAMEDLL_ADD
// wait for any button down, or mp_forcerespawn is set and the respawn time is up // wait for any button down, or mp_forcerespawn is set and the respawn time is up
if (forcerespawn.value > 0 && (fAnyButtonDown || (gpGlobals->time > (m_fDeadTime + forcerespawn.value)))) if (forcerespawn.value > 0 && gpGlobals->time > (m_fDeadTime + forcerespawn.value))
{ {
respawn(pev, FALSE); respawn(pev, FALSE);
pev->button = 0; pev->button = 0;
pev->nextthink = -1; pev->nextthink = -1;
return; return;
} }
#else #endif
if (fAnyButtonDown) if (fAnyButtonDown)
return; return;
#endif
if (g_pGameRules->FPlayerCanRespawn(this)) if (g_pGameRules->FPlayerCanRespawn(this))
{ {
@ -3709,13 +3708,8 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(RoundRespawn)()
pev->nextthink = -1; pev->nextthink = -1;
} }
if (m_pActiveItem) if (m_pActiveItem && m_pActiveItem->iItemSlot() == GRENADE_SLOT)
{
if (m_pActiveItem->iItemSlot() == GRENADE_SLOT)
{
SwitchWeapon(m_pActiveItem); SwitchWeapon(m_pActiveItem);
}
}
m_lastLocation[0] = '\0'; m_lastLocation[0] = '\0';
@ -3732,6 +3726,10 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(RoundRespawn)()
// player off into observer mode // player off into observer mode
void CBasePlayer::StartDeathCam() void CBasePlayer::StartDeathCam()
{ {
#ifdef REGAMEDLL_FXIES
m_canSwitchObserverModes = true;
#endif
if (pev->view_ofs == g_vecZero) if (pev->view_ofs == g_vecZero)
{ {
// don't accept subsequent attempts to StartDeathCam() // don't accept subsequent attempts to StartDeathCam()
@ -4356,12 +4354,14 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(PreThink)()
else else
pev->flags &= ~FL_ONTRAIN; pev->flags &= ~FL_ONTRAIN;
#ifdef REGAMEDLL_ADD
PlayerRespawnThink();
#endif
// Observer Button Handling // Observer Button Handling
if (IsObserver() && (m_afPhysicsFlags & PFLAG_OBSERVER)) if (IsObserver() && (m_afPhysicsFlags & PFLAG_OBSERVER))
{ {
Observer_HandleButtons(); Observer_Think();
Observer_CheckTarget();
Observer_CheckProperties();
return; return;
} }
@ -4925,6 +4925,12 @@ void EXT_FUNC CBasePlayer::__API_VHOOK(PostThink)()
StudioFrameAdvance(); StudioFrameAdvance();
CheckPowerups(); CheckPowerups();
#ifdef REGAMEDLL_ADD
if (m_flTimeStepSound) {
pev->flTimeStepSound = int(m_flTimeStepSound);
}
#endif
// NOTE: this is useless for CS 1.6 - s1lent // NOTE: this is useless for CS 1.6 - s1lent
#ifndef REGAMEDLL_FIXES #ifndef REGAMEDLL_FIXES
UpdatePlayerSound(); UpdatePlayerSound();
@ -8222,6 +8228,16 @@ int GetPlayerGaitsequence(const edict_t *pEdict)
void CBasePlayer::SpawnClientSideCorpse() void CBasePlayer::SpawnClientSideCorpse()
{ {
#ifdef REGAMEDLL_FIXES
// not allow to spawn, if the player was torn to gib
if (pev->effects & EF_NODRAW)
return;
// do not make a corpse if the player goes to respawn.
if (pev->deadflag == DEAD_RESPAWNABLE)
return;
#endif
char *infobuffer = GET_INFO_BUFFER(edict()); char *infobuffer = GET_INFO_BUFFER(edict());
char *pModel = GET_KEY_VALUE(infobuffer, "model"); char *pModel = GET_KEY_VALUE(infobuffer, "model");
@ -8467,14 +8483,13 @@ void CBasePlayer::ClientCommand(const char *cmd, const char *arg1, const char *a
UseBotArgs = true; UseBotArgs = true;
auto pEntity = ENT(pev); auto pEntity = ENT(pev);
auto addr = &::ClientCommand;
// NOTE: force __cdecl to allow cstrike amxx module to hook ClientCommand // NOTE: force __cdecl to allow cstrike amxx module to hook ClientCommand
#if defined _MSC_VER || defined __INTEL_COMPILER #if defined _MSC_VER || defined __INTEL_COMPILER
__asm __asm
{ {
push pEntity; push pEntity
call addr; call ClientCommand_;
add esp, 4; add esp, 4;
} }
#else #else
@ -8484,7 +8499,7 @@ void CBasePlayer::ClientCommand(const char *cmd, const char *arg1, const char *a
"addl %%esp, $4\n\t" "addl %%esp, $4\n\t"
:: ::
"g" (pEntity), "g" (pEntity),
"g" (addr), "g" (ClientCommand_),
); );
#endif // _MSC_VER || defined __INTEL_COMPILER #endif // _MSC_VER || defined __INTEL_COMPILER
@ -9680,3 +9695,29 @@ bool EXT_FUNC CBasePlayer::__API_HOOK(GetIntoGame)()
return true; return true;
} }
void CBasePlayer::PlayerRespawnThink()
{
#ifdef REGAMEDLL_ADD
if (IsObserver() && (m_afPhysicsFlags & PFLAG_OBSERVER) && (m_iTeam == UNASSIGNED || m_iTeam == SPECTATOR))
return;
// Player cannot respawn while in the Choose Appearance menu
if (m_iMenu == Menu_ChooseAppearance || m_iJoiningState == SHOWTEAMSELECT)
return;
if (pev->deadflag < DEAD_DYING)
return;
if (forcerespawn.value)
{
if (gpGlobals->time > (CSPlayer()->m_flRespawnPending + forcerespawn.value))
{
Spawn();
pev->button = 0;
pev->nextthink = -1;
return;
}
}
#endif
}

@ -440,6 +440,7 @@ public:
CBasePlayer *Observer_IsValidTarget_(int iPlayerIndex, bool bSameTeam); CBasePlayer *Observer_IsValidTarget_(int iPlayerIndex, bool bSameTeam);
void Disconnect(); void Disconnect();
void Observer_Think();
void Observer_HandleButtons(); void Observer_HandleButtons();
void Observer_SetMode(int iMode); void Observer_SetMode(int iMode);
void Observer_CheckTarget(); void Observer_CheckTarget();
@ -527,6 +528,7 @@ public:
void SendFOV(int fov); void SendFOV(int fov);
void WaterMove(); void WaterMove();
void EXPORT PlayerDeathThink(); void EXPORT PlayerDeathThink();
void PlayerRespawnThink();
void PlayerUse(); void PlayerUse();
void HostageUsed(); void HostageUsed();
void JoiningThink(); void JoiningThink();

@ -150,12 +150,10 @@ extern globalvars_t *gpGlobals;
#define PLAYBACK_EVENT_DELAY(flags, who, index, delay)\ #define PLAYBACK_EVENT_DELAY(flags, who, index, delay)\
PLAYBACK_EVENT_FULL(flags, who, index, delay, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0) PLAYBACK_EVENT_FULL(flags, who, index, delay, (float *)&g_vecZero, (float *)&g_vecZero, 0.0, 0.0, 0, 0, 0, 0)
#ifndef HOOK_GAMEDLL #if !defined(HOOK_GAMEDLL)
#define __MAKE_VHOOK(fname)\ #define __MAKE_VHOOK(fname)\
fname fname
#endif // !defined(HOOK_GAMEDLL) && defined(REGAMEDLL_API)
#endif
#define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName, DLLClassWrapName)\ #define LINK_ENTITY_TO_CLASS(mapClassName, DLLClassName, DLLClassWrapName)\
C_DLLEXPORT void EXT_FUNC mapClassName(entvars_t *pev);\ C_DLLEXPORT void EXT_FUNC mapClassName(entvars_t *pev);\

@ -105,7 +105,7 @@ public:
virtual void KeyValue(KeyValueData *pkvd) = 0; virtual void KeyValue(KeyValueData *pkvd) = 0;
virtual int Save(CSave &save) = 0; virtual int Save(CSave &save) = 0;
virtual int Restore(CRestore &restore) = 0; virtual int Restore(CRestore &restore) = 0;
virtual int ObjectCaps() = 0 virtual int ObjectCaps() = 0;
virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) = 0; virtual BOOL TakeDamage(entvars_t *pevInflictor, entvars_t *pevAttacker, float flDamage, int bitsDamageType) = 0;
virtual void Touch(CBaseEntity *pOther) = 0; virtual void Touch(CBaseEntity *pOther) = 0;
virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0; virtual void Use(CBaseEntity *pActivator, CBaseEntity *pCaller, USE_TYPE useType, float value) = 0;

@ -325,7 +325,7 @@ void CBot::ClientCommand(const char *cmd, const char *arg1, const char *arg2, co
BotArgs[3] = arg3; BotArgs[3] = arg3;
UseBotArgs = true; UseBotArgs = true;
::ClientCommand(ENT(pev)); ::ClientCommand_(ENT(pev));
UseBotArgs = false; UseBotArgs = false;
} }
#endif #endif

@ -69,7 +69,6 @@ Place PlaceDirectory::EntryToPlace(EntryType entry) const
return UNDEFINED_PLACE; return UNDEFINED_PLACE;
unsigned int i = entry - 1; unsigned int i = entry - 1;
if (i > m_directory.size()) if (i > m_directory.size())
{ {
assert(false && "PlaceDirectory::EntryToPlace: Invalid entry"); assert(false && "PlaceDirectory::EntryToPlace: Invalid entry");
@ -705,7 +704,7 @@ void LoadLocationFile(const char *filename)
Q_strcpy(locFilename, filename); Q_strcpy(locFilename, filename);
char *dot = Q_strchr(locFilename, '.'); char *dot = Q_strchr(locFilename, '.');
if (dot != NULL) if (dot)
{ {
Q_strcpy(dot, ".loc"); Q_strcpy(dot, ".loc");
@ -713,7 +712,7 @@ void LoadLocationFile(const char *filename)
char *locDataFile = (char *)LOAD_FILE_FOR_ME(const_cast<char *>(locFilename), &locDataLength); char *locDataFile = (char *)LOAD_FILE_FOR_ME(const_cast<char *>(locFilename), &locDataLength);
char *locData = locDataFile; char *locData = locDataFile;
if (locData != NULL) if (locData)
{ {
CONSOLE_ECHO("Loading legacy 'location file' '%s'\n", locFilename); CONSOLE_ECHO("Loading legacy 'location file' '%s'\n", locFilename);
@ -748,7 +747,7 @@ void LoadLocationFile(const char *filename)
CNavArea *area = TheNavAreaGrid.GetNavAreaByID(areaID); CNavArea *area = TheNavAreaGrid.GetNavAreaByID(areaID);
unsigned int place = (locDirIndex > 0) ? directory[locDirIndex - 1] : UNDEFINED_PLACE; unsigned int place = (locDirIndex > 0) ? directory[locDirIndex - 1] : UNDEFINED_PLACE;
if (area != NULL) if (area)
area->SetPlace(place); area->SetPlace(place);
} }
} }
@ -880,7 +879,6 @@ NavErrorType LoadNavigationMap()
return NAV_INVALID_FILE; return NAV_INVALID_FILE;
unsigned int bspSize = (unsigned int)GET_FILE_SIZE(bspFilename); unsigned int bspSize = (unsigned int)GET_FILE_SIZE(bspFilename);
if (bspSize != saveBspSize) if (bspSize != saveBspSize)
{ {
// this nav file is out of date for this bsp file // this nav file is out of date for this bsp file

@ -90,6 +90,7 @@ typedef float FloatRef;
#define LINK_HOOK_CLASS_CUSTOM_CHAIN(...) #define LINK_HOOK_CLASS_CUSTOM_CHAIN(...)
#define LINK_HOOK_CLASS_CUSTOM_CHAIN2(...) #define LINK_HOOK_CLASS_CUSTOM_CHAIN2(...)
#define LINK_HOOK_VOID_CHAIN(...) #define LINK_HOOK_VOID_CHAIN(...)
#define LINK_HOOK_VOID_CHAIN2(...)
#define LINK_HOOK_CHAIN(...) #define LINK_HOOK_CHAIN(...)
#define LINK_HOOK_CHAIN2(...) #define LINK_HOOK_CHAIN2(...)

@ -127,10 +127,10 @@ IF NOT %errlvl% == "1" (
) )
:: append extra string :: append extra string
If NOT "%commitURL%"=="%commitURL:bitbucket.org=%" ( If NOT "!commitURL!"=="!commitURL:bitbucket.org=!" (
set commitURL=!commitURL!/commit/
) ELSE (
set commitURL=!commitURL!/commits/ set commitURL=!commitURL!/commits/
) ELSE (
set commitURL=!commitURL!/commit/
) )
) ELSE ( ) ELSE (
@ -142,10 +142,10 @@ IF NOT %errlvl% == "1" (
set commitURL=!commitURL::=/! set commitURL=!commitURL::=/!
:: append extra string :: append extra string
If NOT "%commitURL%"=="%commitURL:bitbucket.org=%" ( If NOT "!commitURL!"=="!commitURL:bitbucket.org=!" (
set commitURL=https://!commitURL!/commit/
) ELSE (
set commitURL=https://!commitURL!/commits/ set commitURL=https://!commitURL!/commits/
) ELSE (
set commitURL=https://!commitURL!/commit/
) )
) )
) )

@ -1417,7 +1417,7 @@
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<MinimumRequiredVersion> <MinimumRequiredVersion>
</MinimumRequiredVersion> </MinimumRequiredVersion>
<ModuleDefinitionFile>mp.def</ModuleDefinitionFile> <ModuleDefinitionFile>mp.def</ModuleDefinitionFile>
@ -1459,7 +1459,7 @@
</ClCompile> </ClCompile>
<Link> <Link>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<MinimumRequiredVersion> <MinimumRequiredVersion>
</MinimumRequiredVersion> </MinimumRequiredVersion>
<ModuleDefinitionFile>mp.def</ModuleDefinitionFile> <ModuleDefinitionFile>mp.def</ModuleDefinitionFile>
@ -1619,7 +1619,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences> <OptimizeReferences>true</OptimizeReferences>
<AdditionalDependencies>%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>$(ProjectDir)../lib/libacof32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<MinimumRequiredVersion /> <MinimumRequiredVersion />
<ModuleDefinitionFile> <ModuleDefinitionFile>
</ModuleDefinitionFile> </ModuleDefinitionFile>

@ -488,7 +488,8 @@ void EXT_FUNC __API_HOOK(PM_UpdateStepSound)()
if ((pmove->flags & FL_DUCKING) || fLadder) if ((pmove->flags & FL_DUCKING) || fLadder)
{ {
pmove->flTimeStepSound += 100; // slower step time if ducking // slower step time if ducking
pmove->flTimeStepSound += 100;
// play the sound // play the sound
// 35% volume if ducking // 35% volume if ducking

@ -83,7 +83,7 @@ char PM_FindTextureType(char *name);
void PM_Init_(struct playermove_s *ppmove); void PM_Init_(struct playermove_s *ppmove);
void PM_Move_(struct playermove_s *ppmove, int server); void PM_Move_(struct playermove_s *ppmove, int server);
void PM_AirMove_(int playerIndex); void PM_AirMove_(int playerIndex = 0);
void PM_AirMove_internal(); void PM_AirMove_internal();
void PM_UpdateStepSound_(); void PM_UpdateStepSound_();

@ -259,8 +259,8 @@ typedef IHookChain<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGa
typedef IHookChainRegistry<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGameHookRegistry_BuyWeaponByWeaponID; typedef IHookChainRegistry<class CBaseEntity *, class CBasePlayer *, WeaponIdType> IReGameHookRegistry_BuyWeaponByWeaponID;
// InternalCommand hook // InternalCommand hook
typedef IHookChain<bool, edict_t *, const char *> IReGameHook_InternalCommand; typedef IHookChain<void, edict_t *, const char *, const char *> IReGameHook_InternalCommand;
typedef IHookChainRegistry<bool, edict_t *, const char *> IReGameHookRegistry_InternalCommand; typedef IHookChainRegistry<void, edict_t *, const char *, const char *> IReGameHookRegistry_InternalCommand;
// CHalfLifeMultiplay::FShouldSwitchWeapon hook // CHalfLifeMultiplay::FShouldSwitchWeapon hook
typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_FShouldSwitchWeapon; typedef IHookChain<BOOL, class CBasePlayer *, class CBasePlayerItem *> IReGameHook_CSGameRules_FShouldSwitchWeapon;

@ -51,7 +51,7 @@ class CCSArmoury: public CCSEntity {};
class CCSPlayer: public CCSMonster { class CCSPlayer: public CCSMonster {
public: public:
CCSPlayer() : m_bForceShowMenu(false) CCSPlayer() : m_bForceShowMenu(false), m_flRespawnPending(0)
{ {
m_szModel[0] = '\0'; m_szModel[0] = '\0';
} }
@ -100,6 +100,7 @@ public:
public: public:
char m_szModel[32]; char m_szModel[32];
bool m_bForceShowMenu; bool m_bForceShowMenu;
float m_flRespawnPending;
}; };
class CAPI_Bot: public CCSPlayer {}; class CAPI_Bot: public CCSPlayer {};

@ -255,8 +255,8 @@ typedef IHookChainImpl<CBaseEntity *, CBasePlayer *, WeaponIdType> CReGameHook_B
typedef IHookChainRegistryImpl<CBaseEntity *, CBasePlayer *, WeaponIdType> CReGameHookRegistry_BuyWeaponByWeaponID; typedef IHookChainRegistryImpl<CBaseEntity *, CBasePlayer *, WeaponIdType> CReGameHookRegistry_BuyWeaponByWeaponID;
// InternalCommand hook // InternalCommand hook
typedef IHookChainImpl<bool, edict_t *, const char *> CReGameHook_InternalCommand; typedef IHookChainImpl<void, edict_t *, const char *, const char *> CReGameHook_InternalCommand;
typedef IHookChainRegistryImpl<bool, edict_t *, const char *> CReGameHookRegistry_InternalCommand; typedef IHookChainRegistryImpl<void, edict_t *, const char *, const char *> CReGameHookRegistry_InternalCommand;
// CHalfLifeMultiplay::FShouldSwitchWeapon hook // CHalfLifeMultiplay::FShouldSwitchWeapon hook
typedef IHookChainClassImpl<BOOL, class CHalfLifeMultiplay, CBasePlayer *, CBasePlayerItem *> CReGameHook_CSGameRules_FShouldSwitchWeapon; typedef IHookChainClassImpl<BOOL, class CHalfLifeMultiplay, CBasePlayer *, CBasePlayerItem *> CReGameHook_CSGameRules_FShouldSwitchWeapon;

@ -73,7 +73,7 @@ bool EXT_FUNC CCSPlayer::JoinTeam(TeamName team)
case CT: case CT:
case TERRORIST: case TERRORIST:
{ {
if (pPlayer->m_iTeam == SPECTATOR) if (pPlayer->m_iTeam == SPECTATOR || pPlayer->m_iTeam == UNASSIGNED)
{ {
// If they're switching into spectator, setup spectator properties.. // If they're switching into spectator, setup spectator properties..
pPlayer->m_bNotKilled = true; pPlayer->m_bNotKilled = true;

@ -30,11 +30,11 @@
#include "maintypes.h" #include "maintypes.h"
#include "regamedll_interfaces.h" #include "regamedll_interfaces.h"
#if !defined(HOOK_GAMEDLL) && defined(REGAMEDLL_API)
#define __API_VHOOK(fname)\ #define __API_VHOOK(fname)\
fname##_ fname##_
#ifndef HOOK_GAMEDLL
#define __API_HOOK __API_VHOOK #define __API_HOOK __API_VHOOK
#define __MAKE_VHOOK(fname)\ #define __MAKE_VHOOK(fname)\
fname fname
@ -94,5 +94,26 @@
ret functionName() {\ ret functionName() {\
return g_ReGameHookchains.m_##functionName.callChain(functionName##_);\ return g_ReGameHookchains.m_##functionName.callChain(functionName##_);\
} }
#else
#endif #define __API_VHOOK(fname)\
fname
#define __API_HOOK __API_VHOOK
#define __MAKE_VHOOK(fname)\
fname
#define LINK_HOOK_CLASS_VOID_CHAIN(...)
#define LINK_HOOK_CLASS_VOID_CHAIN2(...)
#define LINK_HOOK_CLASS_CHAIN(...)
#define LINK_HOOK_CLASS_CHAIN2(...)
#define LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN(...)
#define LINK_HOOK_CLASS_VOID_CUSTOM_CHAIN2(...)
#define LINK_HOOK_CLASS_CUSTOM_CHAIN(...)
#define LINK_HOOK_CLASS_CUSTOM_CHAIN2(...)
#define LINK_HOOK_VOID_CHAIN(...)
#define LINK_HOOK_VOID_CHAIN2(...)
#define LINK_HOOK_CHAIN(...)
#define LINK_HOOK_CHAIN2(...)
#endif // !defined(HOOK_GAMEDLL) && defined(REGAMEDLL_API)