SurvivorBehavior::OnNavAreaChanged
0x009274a0 · 310 bytes · __cdecl
_ZN16SurvivorBehavior16OnNavAreaChangedEP11SurvivorBotP8CNavAreaS3_
Decompiled
undefined (3 params)
/* SurvivorBehavior::OnNavAreaChanged(SurvivorBot*, CNavArea*, CNavArea*) */
SurvivorBot *
SurvivorBehavior::OnNavAreaChanged(SurvivorBot *param_1,CNavArea *param_2,CNavArea *param_3)
{
float fVar1;
int iVar2;
int *piVar3;
undefined4 *puVar4;
longdouble lVar5;
TerrorNavArea *in_stack_00000014;
if (in_stack_00000014 != (TerrorNavArea *)0x0) {
iVar2 = TerrorNavArea::GetDoor(in_stack_00000014);
if (iVar2 != 0) {
iVar2 = SurvivorBot::GetTeamSituation((SurvivorBot *)param_3);
if (*(float *)(in_stack_00000014 + 0x154) <= *(float *)(iVar2 + 0x68)) {
iVar2 = TerrorNavArea::GetDoor(in_stack_00000014);
if (iVar2 != 0) {
piVar3 = (int *)__dynamic_cast(iVar2,&CBaseEntity::typeinfo,&CBasePropDoor::typeinfo,0);
if (piVar3 != (int *)0x0) {
lVar5 = (longdouble)RandomFloat(0x3f000000,0x3f333333);
fVar1 = (float)lVar5;
lVar5 = (longdouble)CountdownTimer::Now();
if ((float)lVar5 + fVar1 != *(float *)(param_2 + 0x7c)) {
(**(code **)(*(int *)(param_2 + 0x74) + 4))(param_2 + 0x74,param_2 + 0x7c);
*(float *)(param_2 + 0x7c) = (float)lVar5 + fVar1;
}
if (fVar1 != *(float *)(param_2 + 0x78)) {
(**(code **)(*(int *)(param_2 + 0x74) + 4))(param_2 + 0x74,param_2 + 0x78);
*(float *)(param_2 + 0x78) = fVar1;
}
puVar4 = (undefined4 *)(**(code **)(*piVar3 + 0xc))(piVar3);
*(undefined4 *)(param_2 + 0x70) = *puVar4;
}
}
}
}
}
*(undefined4 *)param_1 = 0;
*(undefined4 *)(param_1 + 4) = 0;
*(undefined4 *)(param_1 + 8) = 0;
*(undefined4 *)(param_1 + 0xc) = 1;
return param_1;
}
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.