CTeamplayRoundBasedRules::ResetScores
0x004cbdf0 · 228 bytes · __thiscall
_ZN24CTeamplayRoundBasedRules11ResetScoresEv
Decompiled
undefined (1 param)
/* CTeamplayRoundBasedRules::ResetScores() */
void __thiscall CTeamplayRoundBasedRules::ResetScores(CTeamplayRoundBasedRules *this)
{
char cVar1;
int iVar2;
int *piVar3;
int iVar4;
if (this[0x255] != (CTeamplayRoundBasedRules)0x0) {
for (iVar4 = 0; iVar2 = GetNumberOfTeams(), iVar4 < iVar2; iVar4 = iVar4 + 1) {
piVar3 = (int *)GetGlobalTeam(iVar4);
(**(code **)(*piVar3 + 0x368))(piVar3);
}
}
if ((this[0x256] != (CTeamplayRoundBasedRules)0x0) && (0 < *(int *)(gpGlobals + 0x14))) {
iVar4 = 1;
do {
while (((piVar3 = (int *)UTIL_PlayerByIndex(iVar4), piVar3 == (int *)0x0 ||
(cVar1 = (**(code **)(*piVar3 + 0x16c))(piVar3), cVar1 == '\0')) || (piVar3[0xc] == 0)
)) {
LAB_004cbe5b:
iVar4 = iVar4 + 1;
if (*(int *)(gpGlobals + 0x14) < iVar4) goto LAB_004cbeb0;
}
if (piVar3[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
(**(code **)(*piVar3 + 0x760))(piVar3);
goto LAB_004cbe5b;
}
iVar4 = iVar4 + 1;
} while (iVar4 <= *(int *)(gpGlobals + 0x14));
}
LAB_004cbeb0:
if (this[599] != (CTeamplayRoundBasedRules)0x0) {
*(undefined4 *)(this + 0x310) = 0;
}
this[0x255] = (CTeamplayRoundBasedRules)0x1;
this[0x256] = (CTeamplayRoundBasedRules)0x1;
this[599] = (CTeamplayRoundBasedRules)0x1;
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.