L L4D2node

InfectedLieDown::Update

0x00a355d0 · 1014 bytes · __thiscall

_ZN15InfectedLieDown6UpdateEP8Infectedf

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* InfectedLieDown::Update(Infected*, float) */

InfectedLieDown * __thiscall
InfectedLieDown::Update(InfectedLieDown *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/infectedliedown.cpp",0x3a,
               &Update(Infected*,float)::tm_fmt,"(%s)%s","NextBot","InfectedLieDown::Update");
    local_10 = _towlower;
  }
  iVar5 = _DAT_0105db00;
  local_18 = local_24;
  local_14 = local_20;
                    /* try { // try from 00a357a6 to 00a35806 has its CatchHandler @ 00a35a03 */
  if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
     (iVar4 = ThreadGetCurrentId(), iVar5 != iVar4)) {
    iVar5 = *(int *)(ZombieMustWander._28_4_ + 0x30);
  }
  else {
    if ((char *)*_DAT_0105d15c != "InfectedLieDown::Update") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd24240,(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 00a35699 to 00a3569d has its CatchHandler @ 00a359e2 */
    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_00a35709;
  }
  pIVar7 = param_1 + 0x34;
                    /* try { // try from 00a3583c to 00a3595c has its CatchHandler @ 00a359e2 */
  lVar6 = (longdouble)CountdownTimer::Now();
  if ((float)lVar6 < *(float *)(param_1 + 0x3c)) {
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    goto LAB_00a35709;
  }
  if (*(int *)(ZombieMustWander._28_4_ + 0x30) < 0) {
LAB_00a35951:
    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__InfectedSitDown_00d24848;
    puVar3[1] = &PTR__InfectedSitDown_00d249ac;
    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 < 0x4b) goto LAB_00a35951;
    }
    else if (iVar5 < 0x19) goto LAB_00a35951;
    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_00a35709:
  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 into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)