CTerrorGameRules::RecomputeVersusCompletion
0x00508850 · 391 bytes · __thiscall
_ZN16CTerrorGameRules25RecomputeVersusCompletionEb
Decompiled
undefined (2 params)
/* CTerrorGameRules::RecomputeVersusCompletion(bool) */
int __thiscall CTerrorGameRules::RecomputeVersusCompletion(CTerrorGameRules *this,bool param_1)
{
char cVar1;
CTerrorPlayer *pCVar2;
int iVar3;
int iVar4;
int iVar5;
undefined4 uVar6;
int iVar7;
iVar7 = 0;
iVar5 = 0;
do {
pCVar2 = (CTerrorPlayer *)CTerrorPlayer::GetPlayerByCharacter(iVar5);
if ((pCVar2 == (CTerrorPlayer *)0x0) ||
(cVar1 = (**(code **)(*(int *)pCVar2 + 300))(pCVar2), cVar1 == '\0')) {
uVar6 = GetVersusCompletionPerCharacter(this,iVar5,2);
SetVersusDeathDistancePerCharacter(this,iVar5,2,uVar6);
}
else {
iVar3 = GetVersusCompletion(this,pCVar2);
iVar4 = GetVersusCompletionPerCharacter(this,iVar5,2);
if (iVar4 < iVar3) {
SetVersusCompletionPerCharacter(this,iVar5,2,iVar3);
}
iVar3 = GetVersusDeathDistancePerCharacter(this,iVar5,2);
if (iVar3 != -1) {
SetVersusDeathDistancePerCharacter(this,iVar5,2,0xffffffff);
}
}
if (param_1) {
cVar1 = CDirector::IsFinale(TheDirector);
if (cVar1 == '\0') {
iVar3 = GetVersusSurvivalMultiplier(this,2);
if (iVar3 == 0) goto LAB_00508991;
}
else if (this[iVar5 + 0x424] == (CTerrorGameRules)0x0) {
LAB_00508991:
uVar6 = GetVersusCompletionPerCharacter(this,iVar5,2);
SetVersusDeathDistancePerCharacter(this,iVar5,2,uVar6);
}
}
iVar3 = iVar5 + 1;
iVar5 = GetVersusCompletionPerCharacter(this,iVar5,2);
iVar7 = iVar7 + iVar5;
iVar5 = iVar3;
if (iVar3 == 4) {
return iVar7;
}
} while( true );
}
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.