InfectedSitDown::Update
0x00a36ae0 · 1014 bytes · __thiscall
_ZN15InfectedSitDown6UpdateEP8Infectedf
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* InfectedSitDown::Update(Infected*, float) */
InfectedSitDown * __thiscall
InfectedSitDown::Update(InfectedSitDown *this,Infected *param_1,float param_2)
{
uint *puVar1;
char cVar2;
undefined4 *puVar3;
int iVar4;
int iVar5;
longdouble lVar6;
Infected *pIVar7;
undefined4 local_24;
undefined4 local_20;
undefined4 local_18;
undefined4 local_14;
int local_10;
local_24 = 0;
local_20 = 0;
if (_towlower == 0) {
local_10 = 0;
}
else {
(**(code **)(_towlower + 0x50))
(_towlower,&local_24,0,0,0,0,
"/data/src/game/server/terror/zombiebot/infected/infectedsitdown.cpp",0x39,
&Update(Infected*,float)::tm_fmt,"(%s)%s","NextBot","InfectedSitDown::Update");
local_10 = _towlower;
}
iVar5 = _DAT_0105db00;
local_18 = local_24;
local_14 = local_20;
/* try { // try from 00a36cb6 to 00a36d16 has its CatchHandler @ 00a36f13 */
if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
(iVar4 = ThreadGetCurrentId(), iVar5 != iVar4)) {
iVar5 = *(int *)(ZombieMustWander._28_4_ + 0x30);
}
else {
if ((char *)*_DAT_0105d15c != "InfectedSitDown::Update") {
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd24740,(char *)0x0,0xca8906);
}
puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
*puVar1 = *puVar1 | 4;
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
iVar5 = *(int *)(ZombieMustWander._28_4_ + 0x30);
}
if ((0 < iVar5) || (*(char *)(*(int *)(TheDirector + 0x634) + 0x37) != '\0')) {
pIVar7 = (Infected *)&DAT_00000034;
/* try { // try from 00a36ba9 to 00a36bad has its CatchHandler @ 00a36ef2 */
puVar3 = ::operator_new(0x34);
puVar3[8] = 0;
puVar3[9] = 0;
puVar3[10] = 0;
puVar3[3] = 0;
puVar3[4] = 0;
puVar3[5] = 0;
puVar3[6] = 0;
puVar3[7] = 0;
puVar3[2] = 0;
*(undefined1 *)(puVar3 + 0xc) = 0;
*(undefined1 *)((int)puVar3 + 0x31) = 0;
puVar3[0xb] = 0;
*puVar3 = &PTR__InfectedStandDazed_00d25148;
puVar3[1] = &PTR__InfectedStandDazed_00d252ac;
*(undefined4 *)this = 1;
*(undefined4 **)(this + 4) = puVar3;
*(char **)(this + 8) = "Low-violence mode enabled";
goto LAB_00a36c19;
}
pIVar7 = param_1 + 0x34;
/* try { // try from 00a36d4c to 00a36e6c has its CatchHandler @ 00a36ef2 */
lVar6 = (longdouble)CountdownTimer::Now();
if ((float)lVar6 < *(float *)(param_1 + 0x3c)) {
*(undefined4 *)this = 0;
*(undefined4 *)(this + 4) = 0;
*(undefined4 *)(this + 8) = 0;
goto LAB_00a36c19;
}
if (*(int *)(ZombieMustWander._28_4_ + 0x30) < 0) {
LAB_00a36e61:
pIVar7 = (Infected *)0x40;
puVar3 = ::operator_new(0x40);
puVar3[8] = 0;
puVar3[9] = 0;
puVar3[10] = 0;
puVar3[3] = 0;
puVar3[4] = 0;
puVar3[5] = 0;
puVar3[6] = 0;
puVar3[7] = 0;
puVar3[2] = 0;
*(undefined1 *)(puVar3 + 0xc) = 0;
*(undefined1 *)((int)puVar3 + 0x31) = 0;
puVar3[0xb] = 0;
*puVar3 = &PTR__InfectedLieDown_00d24368;
puVar3[1] = &PTR__InfectedLieDown_00d244cc;
puVar3[0xd] = &PTR_NetworkStateChanged_00c0b6e0;
puVar3[0xe] = 0;
puVar3[0xf] = 0xbf800000;
*(undefined4 *)this = 1;
*(undefined4 **)(this + 4) = puVar3;
*(undefined4 *)(this + 8) = 0;
}
else {
iVar5 = RandomInt(0,100);
cVar2 = Infected::IsOutside((Infected *)param_2);
if (cVar2 == '\0') {
if (iVar5 < 0x32) goto LAB_00a36e61;
}
else if (iVar5 < 0x19) goto LAB_00a36e61;
pIVar7 = (Infected *)&DAT_00000034;
puVar3 = ::operator_new(0x34);
puVar3[8] = 0;
puVar3[9] = 0;
puVar3[10] = 0;
puVar3[3] = 0;
puVar3[4] = 0;
puVar3[5] = 0;
puVar3[6] = 0;
puVar3[7] = 0;
puVar3[2] = 0;
*(undefined1 *)(puVar3 + 0xc) = 0;
*(undefined1 *)((int)puVar3 + 0x31) = 0;
puVar3[0xb] = 0;
*puVar3 = &PTR__InfectedStandDazed_00d25148;
puVar3[1] = &PTR__InfectedStandDazed_00d252ac;
*(undefined4 *)this = 1;
*(undefined4 **)(this + 4) = puVar3;
*(undefined4 *)(this + 8) = 0;
}
LAB_00a36c19:
iVar5 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar4 = ThreadGetCurrentId(pIVar7), iVar5 == iVar4)) {
cVar2 = CVProfNode::ExitScope();
if (cVar2 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_10 != 0) {
(**(code **)(local_10 + 0x54))(local_10,local_18,local_14,0,0,0);
}
return this;
}
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.