CCSGameRules::CheckFreezePeriodExpired
0x004374b0 · 778 bytes · __thiscall
_ZN12CCSGameRules24CheckFreezePeriodExpiredEv
Decompiled
undefined (1 param)
/* CCSGameRules::CheckFreezePeriodExpired() */
void __thiscall CCSGameRules::CheckFreezePeriodExpired(CCSGameRules *this)
{
float fVar1;
int iVar2;
CBaseEntity *this_00;
int iVar3;
int in_GS_OFFSET;
char local_70 [40];
char local_48 [40];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
fVar1 = *(float *)(this + 0x244);
if (((uint)fVar1 & 0x7f800000) == 0x7f800000) {
Warning("Infinite round start time!\n");
CGameRulesProxy::NotifyNetworkStateChanged();
*(undefined4 *)(this + 0x244) = *(undefined4 *)(gpGlobals + 0xc);
}
else if (*(float *)(gpGlobals + 0xc) <= fVar1 && fVar1 != *(float *)(gpGlobals + 0xc))
goto LAB_004374ea;
UTIL_LogPrintf("World triggered \"Round_Start\"\n");
iVar2 = (**(code **)(*random_valve + 8))(random_valve,0,3);
if (iVar2 == 1) {
V_strncpy(local_70,"radio.letsgo",0x28);
V_strncpy(local_48,"radio.letsgo",0x28);
}
else if (iVar2 == 2) {
V_strncpy(local_70,"radio.locknload",0x28);
V_strncpy(local_48,"radio.locknload",0x28);
}
else if (iVar2 == 0) {
V_strncpy(local_70,"radio.moveout",0x28);
V_strncpy(local_48,"radio.moveout",0x28);
}
else {
V_strncpy(local_70,"radio.go",0x28);
V_strncpy(local_48,"radio.go",0x28);
}
if (this[0x2b8] == (CCSGameRules)0x0) {
if (*(int *)(this + 0x2c4) == 1) {
V_strncpy(local_70,"radio.vip",0x28);
V_strncpy(local_48,"radio.locknload",0x28);
}
}
else {
V_strncpy(local_70,"radio.elim",0x28);
V_strncpy(local_48,"radio.getout",0x28);
}
if (this[0x23d] != (CCSGameRules)0x0) {
CGameRulesProxy::NotifyNetworkStateChanged();
this[0x23d] = (CCSGameRules)0x0;
}
iVar2 = (**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"round_freeze_end",0,0);
if (iVar2 != 0) {
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,iVar2,0);
}
iVar2 = 1;
if (0 < *(int *)(gpGlobals + 0x14)) {
do {
this_00 = (CBaseEntity *)CCSPlayer::Instance(iVar2);
if ((((this_00 != (CBaseEntity *)0x0) && (*(int *)(this_00 + 0x30) != 0)) &&
(*(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
(*(int *)(this_00 + 0x23bc) == 0)) {
CBaseEntity::GetTeamNumber(this_00);
CBaseEntity::GetTeamNumber(this_00);
iVar3 = CBaseEntity::GetTeamNumber(this_00);
if (iVar3 != 1) {
(**(code **)(*(int *)this_00 + 0x81c))(this_00);
}
}
iVar2 = iVar2 + 1;
} while (iVar2 <= *(int *)(gpGlobals + 0x14));
}
LAB_004374ea:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.