CTeamplayRoundBasedRules::CheckTimeLimit
0x004c9fa0 · 453 bytes · __thiscall
_ZN24CTeamplayRoundBasedRules14CheckTimeLimitEv
Decompiled
undefined (1 param)
/* CTeamplayRoundBasedRules::CheckTimeLimit() */
undefined4 __thiscall CTeamplayRoundBasedRules::CheckTimeLimit(CTeamplayRoundBasedRules *this)
{
int iVar1;
bool bVar2;
char cVar3;
int *piVar4;
int iVar5;
if ((*(int *)(mp_tournament._28_4_ + 0x30) != 0) && (this[0x328] != (CTeamplayRoundBasedRules)0x0)
) {
return 0;
}
if ((*(int *)(mp_timelimit._28_4_ + 0x30) < 1) ||
(cVar3 = (**(code **)(*(int *)this + 0x2ec))(this), cVar3 == '\0')) {
if (this[0x309] == (CTeamplayRoundBasedRules)0x0) {
return 0;
}
iVar5 = *(int *)(mp_timelimit._28_4_ + 0x30);
if (iVar5 < 6) goto LAB_004ca006;
LAB_004ca0f8:
bVar2 = (int)(((float)(iVar5 * 0x3c) - *(float *)(gpGlobals + 0xc)) + *(float *)(this + 0x330))
< 300;
iVar1 = *(int *)(mp_tournament._28_4_ + 0x30);
}
else {
iVar5 = *(int *)(mp_timelimit._28_4_ + 0x30);
if (5 < iVar5) goto LAB_004ca0f8;
LAB_004ca006:
bVar2 = false;
iVar1 = *(int *)(mp_tournament._28_4_ + 0x30);
}
if (iVar1 == 0) {
cVar3 = (**(code **)(*(int *)this + 0x29c))(this);
iVar5 = *(int *)(mp_timelimit._28_4_ + 0x30);
if (cVar3 == '\0') goto LAB_004ca019;
}
bVar2 = false;
LAB_004ca019:
if (((0 < (int)((*(float *)(this + 0x330) - *(float *)(gpGlobals + 0xc)) + (float)(iVar5 * 0x3c)))
&& (this[0x309] == (CTeamplayRoundBasedRules)0x0)) && (!bVar2)) {
return 0;
}
piVar4 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"teamplay_game_over",0,0)
;
if (piVar4 != (int *)0x0) {
(**(code **)(*piVar4 + 0x3c))(piVar4,"reason","Reached Time Limit");
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar4,0);
}
(**(code **)(*(int *)this + 0x2b4))(this);
(**(code **)(*(int *)this + 0x248))(this);
return 1;
}
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.