CTerrorPlayer::GetSurvivorModelName
0x009b2930 · 347 bytes · __thiscall
_ZN13CTerrorPlayer20GetSurvivorModelNameE21SurvivorCharacterType
Decompiled
undefined (2 params)
/* CTerrorPlayer::GetSurvivorModelName(SurvivorCharacterType) */
undefined4 __thiscall CTerrorPlayer::GetSurvivorModelName(undefined4 this,int param_2)
{
char *pcVar1;
int iVar2;
KeyValues *pKVar3;
undefined4 uVar4;
int in_GS_OFFSET;
undefined **local_12c;
undefined1 local_128;
char local_127 [259];
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if (param_2 - 4U < 4) {
pcVar1 = (char *)SurvivorCharacterName(param_2);
iVar2 = _V_strcmp(pcVar1,"TeenGirl");
local_12c = &PTR_InitQuietTruncation_00c08ee8;
if (iVar2 == 0) {
pcVar1 = "TeenAngst";
}
local_128 = 1;
local_127[0] = '\0';
local_24 = 0;
CFmtStrN<256>::sprintf((CFmtStrN<256> *)&local_12c,"survivor_%s_light",pcVar1);
pKVar3 = (KeyValues *)CDirector::GetPopulationData(TheDirector);
if (pKVar3 != (KeyValues *)0x0) {
pcVar1 = "FCVAR_NEVER_AS_STRING";
if ((ZombiePopulation[0x15] & 0x10) == 0) {
pcVar1 = "";
if (*(char **)(ZombiePopulation._28_4_ + 0x24) != (char *)0x0) {
pcVar1 = *(char **)(ZombiePopulation._28_4_ + 0x24);
}
}
pKVar3 = (KeyValues *)KeyValues::FindKey(pKVar3,pcVar1,false);
if (pKVar3 != (KeyValues *)0x0) {
pKVar3 = (KeyValues *)KeyValues::GetFirstSubKey(pKVar3);
if (pKVar3 != (KeyValues *)0x0) {
do {
pcVar1 = (char *)KeyValues::GetName(pKVar3);
iVar2 = _V_strlen(local_127);
iVar2 = V_strnicmp(pcVar1,local_127,iVar2);
if (iVar2 == 0) {
uVar4 = *(undefined4 *)(SurvivorModelsLight + param_2 * 4);
goto LAB_009b2a7c;
}
pKVar3 = (KeyValues *)KeyValues::GetNextKey(pKVar3);
} while (pKVar3 != (KeyValues *)0x0);
}
}
}
}
iVar2 = ConvertToExternalCharacter(param_2);
uVar4 = *(undefined4 *)(SurvivorModels + iVar2 * 4);
LAB_009b2a7c:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return uVar4;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.