CTerrorGameRules::RestartRound
0x00505bd0 · 1039 bytes · __thiscall
_ZN16CTerrorGameRules12RestartRoundEv
Decompiled
undefined (1 param)
/* CTerrorGameRules::RestartRound() */
void __thiscall CTerrorGameRules::RestartRound(CTerrorGameRules *this)
{
float fVar1;
uint uVar2;
CBaseEdict *this_00;
char cVar3;
CBaseEntity *this_01;
undefined *puVar4;
int iVar5;
NextBotManager *this_02;
int *piVar6;
int iVar7;
color32_s local_20;
undefined1 local_1f;
undefined1 local_1e;
undefined1 local_1d;
*(undefined4 *)(this + 0x20) = 0;
*(undefined4 *)(this + 0x268) = 0;
*(undefined4 *)(this + 600) = 0;
*(undefined4 *)(this + 0x428) = 0;
*(undefined4 *)(this + 0xdf4) = 0;
this[0x424] = (CTerrorGameRules)0x0;
this[0x425] = (CTerrorGameRules)0x0;
this[0x426] = (CTerrorGameRules)0x0;
this[0x427] = (CTerrorGameRules)0x0;
*(undefined4 *)(this + 0x314) = 0xffffffff;
*(undefined4 *)(this + 0x318) = 0;
*(undefined4 *)(this + 0x31c) = 0;
*(undefined4 *)(this + 800) = 0;
*(undefined4 *)(this + 0x324) = 0;
*(undefined4 *)(this + 0x328) = 0;
*(undefined4 *)(this + 0x32c) = 0;
if (*(float *)(this + 0x444) == 0.0) {
fVar1 = *(float *)(this + 0x448);
}
else {
CGameRulesProxy::NotifyNetworkStateChanged();
fVar1 = *(float *)(this + 0x448);
*(undefined4 *)(this + 0x444) = 0;
}
if (fVar1 == 0.0) {
fVar1 = *(float *)(this + 0x44c);
}
else {
CGameRulesProxy::NotifyNetworkStateChanged();
*(undefined4 *)(this + 0x448) = 0;
fVar1 = *(float *)(this + 0x44c);
}
if (fVar1 != 0.0) {
CGameRulesProxy::NotifyNetworkStateChanged();
*(undefined4 *)(this + 0x44c) = 0;
}
*(int *)(this + 0x25c) = *(int *)(this + 0x25c) + 1;
if (this[0x23d] != (CTerrorGameRules)0x1) {
CGameRulesProxy::NotifyNetworkStateChanged();
this[0x23d] = (CTerrorGameRules)0x1;
}
if (*(int *)(this + 0x498) != 0) {
CGameRulesProxy::NotifyNetworkStateChanged();
*(undefined4 *)(this + 0x498) = 0;
}
CCSGameRules::ReadMultiplayCvars((CCSGameRules *)this);
fVar1 = *(float *)(gpGlobals + 0xc);
iVar5 = gpGlobals;
if (fVar1 != *(float *)(this + 0x244)) {
CGameRulesProxy::NotifyNetworkStateChanged();
iVar5 = gpGlobals;
*(float *)(this + 0x244) = fVar1;
}
iVar7 = 1;
if (0 < *(int *)(iVar5 + 0x14)) {
do {
this_01 = (CBaseEntity *)UTIL_PlayerByIndex(iVar7);
if ((this_01 != (CBaseEntity *)0x0) &&
(cVar3 = (**(code **)(*(int *)this_01 + 0x16c))(this_01), cVar3 != '\0')) {
(**(code **)(*(int *)this_01 + 0x98))(this_01,0,0xffffffff);
uVar2 = *(uint *)(this_01 + 0x1d14);
if ((uVar2 != 0xffffffff) &&
(((puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc &&
(*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) && (*(int *)(puVar4 + 4) != 0)))) {
if (this_01[0x6c] == (CBaseEntity)0x0) {
this_00 = *(CBaseEdict **)(this_01 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar5 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar5 + 2) = 0;
}
}
else {
this_01[0x70] = (CBaseEntity)((byte)this_01[0x70] | 1);
}
*(undefined4 *)(this_01 + 0x1d14) = 0xffffffff;
}
(**(code **)(*(int *)this_01 + 0x76c))(this_01);
this_01[0x23ec] = (CBaseEntity)0x0;
*(undefined4 *)(this_01 + 0x23e4) = 0;
iVar5 = CBaseEntity::GetTeamNumber(this_01);
if ((iVar5 == 3) || (iVar5 = CBaseEntity::GetTeamNumber(this_01), iVar5 == 2)) {
CCollisionProperty::SetSolidFlags
((CCollisionProperty *)(this_01 + 0x194),
(uint)(*(ushort *)(this_01 + 0x1b4) | 4));
}
local_20 = (color32_s)0x0;
local_1f = 0;
local_1e = 0;
local_1d = 0;
UTIL_ScreenFade(this_01,&local_20,0.01,0.0,0x12);
}
iVar7 = iVar7 + 1;
} while (iVar7 <= *(int *)(gpGlobals + 0x14));
}
iVar5 = (**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"round_start_pre_entity",0,0);
if (iVar5 != 0) {
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,iVar5,0);
}
Commentary_AbortCurrentNode();
(**(code **)(*(int *)this + 0x2d0))(this);
FireGameModeOutputsPostSpawn();
(**(code **)(*TheDirector + 0x20))(TheDirector);
this_02 = (NextBotManager *)TheNextBots();
NextBotManager::OnRoundRestart(this_02);
ZombieManager::RestartRound(TheZombieManager);
piVar6 = (int *)(**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"round_start",0,0);
if (piVar6 != (int *)0x0) {
(**(code **)(*piVar6 + 0x30))(piVar6,"timelimit",*(undefined4 *)(this + 0x240));
(**(code **)(*piVar6 + 0x30))(piVar6,"fraglimit",0);
(**(code **)(*piVar6 + 0x3c))(piVar6,"objective","ESCAPE");
(**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar6,0);
}
FireGameModeOutputsPreRound();
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.