CreateAttractGoal
0x00a2c9f0 · 410 bytes · __cdecl
_Z17CreateAttractGoalP8Infected
Decompiled
undefined (1 param)
/* CreateAttractGoal(Infected*) */
void CreateAttractGoal(Infected *param_1)
{
char cVar1;
int iVar2;
CBaseEntity *pCVar3;
undefined4 *puVar4;
undefined4 local_50;
undefined4 local_4c;
undefined4 local_48;
undefined4 local_44;
undefined4 local_40;
undefined4 local_3c;
int local_38;
undefined4 local_34;
char *local_30 [3];
undefined4 local_24;
undefined4 local_20;
iVar2 = CBaseEntity::GetGender((CBaseEntity *)param_1);
if ((iVar2 != 0x10) && (iVar2 = CBaseEntity::GetGender((CBaseEntity *)param_1), iVar2 != 0x11)) {
return;
}
if (((byte)param_1[0x1c75] & 1) != 0) {
return;
}
local_44 = 0;
local_40 = 0;
local_3c = 0;
local_38 = 0;
local_34 = 0;
/* try { // try from 00a2ca56 to 00a2cb8f has its CatchHandler @ 00a2cb95 */
GetAllChildren((CBaseEntity *)param_1,(CUtlVector *)&local_44);
if ((local_38 < 1) &&
(pCVar3 = (CBaseEntity *)CreateEntityByName("info_goal_infected_chase",-1,true),
pCVar3 != (CBaseEntity *)0x0)) {
DispatchSpawn(pCVar3,true);
puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0x288))(param_1);
local_50 = *puVar4;
local_4c = puVar4[1];
local_48 = puVar4[2];
(**(code **)(*(int *)pCVar3 + 0x1dc))(pCVar3,&local_50,&vec3_angle,&vec3_origin);
local_30[0] = (char *)0x0;
local_24 = 0xffffffff;
local_20 = 0;
(**(code **)(*(int *)pCVar3 + 0xb4))(pCVar3,"Enable",param_1,param_1,local_30,0);
(**(code **)(*(int *)pCVar3 + 0x98))(pCVar3,param_1,0xffffffff);
cVar1 = CDirector::IsFinale(TheDirector);
if ((cVar1 == '\0') && (iVar2 = CBaseEntity::GetGender((CBaseEntity *)param_1), iVar2 == 0x10))
{
local_30[0] = "clown";
ForEachSurvivor<ChangeSurvivorZombatMusicSuffix>((ChangeSurvivorZombatMusicSuffix *)local_30);
}
}
local_38 = 0;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_44);
local_34 = local_44;
CUtlMemory<CBaseEntity*,int>::Purge((CUtlMemory<CBaseEntity*,int> *)&local_44);
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.