CTeamplayRoundBasedRules::State_Enter_STALEMATE
0x004cac20 · 848 bytes · __thiscall
_ZN24CTeamplayRoundBasedRules21State_Enter_STALEMATEEv
Decompiled
undefined (1 param)
/* CTeamplayRoundBasedRules::State_Enter_STALEMATE() */
void __thiscall CTeamplayRoundBasedRules::State_Enter_STALEMATE(CTeamplayRoundBasedRules *this)
{
uint uVar1;
char cVar2;
int *piVar3;
uint *puVar4;
int iVar5;
undefined4 *puVar6;
undefined *puVar7;
uint uVar8;
int *local_40;
int local_30 [3];
undefined4 local_24;
undefined4 local_20;
*(undefined4 *)(this + 0x260) = *(undefined4 *)(gpGlobals + 0xc);
(**(code **)(*(int *)this + 0x2c0))(this);
HideActiveTimer(this);
uVar1 = *(uint *)(this + 0x25c);
if ((((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
(*(CBaseEntity **)(puVar7 + 4) != (CBaseEntity *)0x0)) {
UTIL_Remove(*(CBaseEntity **)(puVar7 + 4));
*(undefined4 *)(this + 0x25c) = 0xffffffff;
}
iVar5 = *(int *)(mp_stalemate_timelimit._28_4_ + 0x30);
cVar2 = (**(code **)(*(int *)this + 0x29c))(this);
if (cVar2 != '\0') {
iVar5 = *(int *)(tf_arena_round_time._28_4_ + 0x30);
}
if (iVar5 < 1) {
return;
}
uVar1 = *(uint *)(this + 0x25c);
if (uVar1 == 0xffffffff) {
LAB_004cacda:
piVar3 = (int *)CBaseEntity::Create("team_round_timer",(Vector *)&vec3_origin,
(QAngle *)&vec3_angle,(CBaseEntity *)0x0);
if (piVar3 == (int *)0x0) {
*(undefined4 *)(this + 0x25c) = 0xffffffff;
}
else {
puVar4 = (uint *)(**(code **)(*piVar3 + 0xc))(piVar3);
puVar7 = g_pEntityList;
uVar1 = *puVar4;
*(uint *)(this + 0x25c) = uVar1;
if (((uVar1 != 0xffffffff) &&
(puVar6 = (undefined4 *)(puVar7 + (uVar1 & 0xfff) * 0x10 + 4), puVar6 != (undefined4 *)0x0
)) && (puVar6[1] == uVar1 >> 0xc)) goto LAB_004caf45;
}
piVar3 = (int *)0x0;
}
else {
uVar8 = uVar1 & 0xfff;
puVar6 = (undefined4 *)(g_pEntityList + uVar8 * 0x10 + 4);
if (((puVar6 == (undefined4 *)0x0) ||
(*(uint *)(g_pEntityList + uVar8 * 0x10 + 8) != uVar1 >> 0xc)) ||
(*(int *)(g_pEntityList + uVar8 * 0x10 + 4) == 0)) goto LAB_004cacda;
LAB_004caf45:
piVar3 = (int *)*puVar6;
}
(**(code **)(*piVar3 + 0x84))(piVar3,"show_in_hud",&DAT_00cbe2d5);
uVar1 = *(uint *)(this + 0x25c);
piVar3 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
piVar3 = *(int **)(puVar7 + 4);
}
local_24 = 0xffffffff;
local_20 = 5;
local_30[0] = iVar5;
(**(code **)(*piVar3 + 0xb4))(piVar3,"SetTime",0,0,local_30,0);
uVar1 = *(uint *)(this + 0x25c);
local_40 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
local_40 = *(int **)(puVar7 + 4);
}
local_24 = 0xffffffff;
local_20 = 5;
local_30[0] = iVar5;
(**(code **)(*local_40 + 0xb4))(local_40,"Resume",0,0,local_30,0);
uVar1 = *(uint *)(this + 0x25c);
piVar3 = (int *)0x0;
if (((uVar1 != 0xffffffff) &&
(puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
piVar3 = *(int **)(puVar7 + 4);
}
local_24 = 0xffffffff;
local_20 = 5;
local_30[0] = iVar5;
(**(code **)(*piVar3 + 0xb4))(piVar3,"Enable",0,0,local_30,0);
iVar5 = (**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"teamplay_update_timer",0,0);
if (iVar5 != 0) {
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,iVar5,0);
}
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.