L L4D2node

InfectedWander::InitialContainedAction

0x00a39d60 · 605 bytes · __thiscall

_ZN14InfectedWander22InitialContainedActionEP8Infected

Decompiled

undefined (2 params)

/* InfectedWander::InitialContainedAction(Infected*) */

void __thiscall InfectedWander::InitialContainedAction(InfectedWander *this,Infected *param_1)

{
  char cVar1;
  undefined4 *puVar2;
  int iVar3;
  int iVar4;
  
  if (*(int *)(this + 0x34) != 0) {
    return;
  }
  if (0 < *(int *)(ZombieStandStill._28_4_ + 0x30)) {
LAB_00a39d8c:
    puVar2 = ::operator_new(0x34);
    puVar2[8] = 0;
    puVar2[9] = 0;
    puVar2[10] = 0;
    puVar2[3] = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    puVar2[7] = 0;
    puVar2[2] = 0;
    *(undefined1 *)(puVar2 + 0xc) = 0;
    *(undefined1 *)((int)puVar2 + 0x31) = 0;
    puVar2[0xb] = 0;
    *puVar2 = &PTR__InfectedStandDazed_00d25148;
    puVar2[1] = &PTR__InfectedStandDazed_00d252ac;
    return;
  }
  iVar3 = RandomInt(0,100);
  iVar4 = (**(code **)(*(int *)param_1 + 0x52c))(param_1);
  if (((iVar4 != 0) && ((*(byte *)(iVar4 + 0x12e) & 0x10) != 0)) &&
     (iVar3 < *(int *)(NavLyingDownPercent._28_4_ + 0x30))) goto LAB_00a39e47;
  cVar1 = IsTimeOfDayBetween(2,4);
  if (((0 < *(int *)(ZombieMustWander._28_4_ + 0x30)) ||
      (*(char *)(*(int *)(TheDirector + 0x634) + 0x37) != '\0')) || (cVar1 != '\0'))
  goto LAB_00a39d8c;
  if (*(int *)(ZombieMustWander._28_4_ + 0x30) == 0) {
    cVar1 = Infected::IsOutside(param_1);
    if (cVar1 == '\0') {
      if (0xe < iVar3) {
        if (0x1d < iVar3) goto LAB_00a39d8c;
        goto LAB_00a39f3c;
      }
    }
    else if (4 < iVar3) {
      if (9 < iVar3) goto LAB_00a39d8c;
      goto LAB_00a39f3c;
    }
LAB_00a39e47:
    puVar2 = ::operator_new(0x40);
    puVar2[8] = 0;
    puVar2[9] = 0;
    puVar2[10] = 0;
    puVar2[3] = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    puVar2[7] = 0;
    puVar2[2] = 0;
    *(undefined1 *)(puVar2 + 0xc) = 0;
    *(undefined1 *)((int)puVar2 + 0x31) = 0;
    puVar2[0xb] = 0;
    *puVar2 = &PTR__InfectedLieDown_00d24368;
    puVar2[1] = &PTR__InfectedLieDown_00d244cc;
    puVar2[0xd] = &PTR_NetworkStateChanged_00c0b6e0;
    puVar2[0xe] = 0;
    puVar2[0xf] = 0xbf800000;
  }
  else {
LAB_00a39f3c:
    puVar2 = ::operator_new(0x40);
    puVar2[8] = 0;
    puVar2[9] = 0;
    puVar2[10] = 0;
    puVar2[3] = 0;
    puVar2[4] = 0;
    puVar2[5] = 0;
    puVar2[6] = 0;
    puVar2[7] = 0;
    puVar2[2] = 0;
    *(undefined1 *)(puVar2 + 0xc) = 0;
    *(undefined1 *)((int)puVar2 + 0x31) = 0;
    puVar2[0xb] = 0;
    *puVar2 = &PTR__InfectedSitDown_00d24848;
    puVar2[1] = &PTR__InfectedSitDown_00d249ac;
    puVar2[0xd] = &PTR_NetworkStateChanged_00c0b6e0;
    puVar2[0xe] = 0;
    puVar2[0xf] = 0xbf800000;
  }
  return;
}

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)