L L4D2node

InfectedAlert::OnStart

0x00a1a880 · 607 bytes · __thiscall

_ZN13InfectedAlert7OnStartEP8InfectedP6ActionIS0_E

Decompiled

undefined (3 params)

/* InfectedAlert::OnStart(Infected*, Action<Infected>*) */

InfectedAlert * __thiscall
InfectedAlert::OnStart(InfectedAlert *this,Infected *param_1,Action *param_2)

{
  float fVar1;
  char cVar2;
  int *piVar3;
  undefined4 *puVar4;
  InfectedWander *this_00;
  longdouble lVar5;
  
  piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
  (**(code **)(*piVar3 + 0x10c))(piVar3,1);
  CBaseEntity::EmitSound((CBaseEntity *)param_2,"Zombie.BecomeAlert",0.0,(float *)0x0);
  lVar5 = (longdouble)RandomFloat(0x40000000,0x40800000);
  fVar1 = (float)lVar5;
  lVar5 = (longdouble)CountdownTimer::Now();
  if ((float)lVar5 + fVar1 != *(float *)(param_1 + 100)) {
    (**(code **)(*(int *)(param_1 + 0x5c) + 4))(param_1 + 0x5c,param_1 + 100);
    *(float *)(param_1 + 100) = (float)lVar5 + fVar1;
  }
  if (fVar1 != *(float *)(param_1 + 0x60)) {
    (**(code **)(*(int *)(param_1 + 0x5c) + 4))(param_1 + 0x5c,param_1 + 0x60);
    *(float *)(param_1 + 0x60) = fVar1;
  }
  cVar2 = (**(code **)(*piVar3 + 0x100))(piVar3,2);
  if (cVar2 == '\0') {
    cVar2 = (**(code **)(*piVar3 + 0x100))(piVar3,4);
    if (cVar2 == '\0') {
      cVar2 = LookTowardsDisturbance((InfectedAlert *)param_1,(Infected *)param_2);
      if (cVar2 != '\0') {
        if (*(float *)(param_1 + 0x58) != -1.0) {
          (**(code **)(*(int *)(param_1 + 0x50) + 4))(param_1 + 0x50,param_1 + 0x58);
          *(undefined4 *)(param_1 + 0x58) = 0xbf800000;
        }
        *(undefined4 *)this = 0;
        *(undefined4 *)(this + 4) = 0;
        *(undefined4 *)(this + 8) = 0;
        return this;
      }
      this_00 = ::operator_new(0x74);
                    /* try { // try from 00a1aac9 to 00a1aacd has its CatchHandler @ 00a1aaea */
      InfectedWander::InfectedWander(this_00,(Action *)0x0);
      *(undefined4 *)this = 1;
      *(InfectedWander **)(this + 4) = this_00;
      *(undefined4 *)(this + 8) = 0;
      return this;
    }
  }
  puVar4 = ::operator_new(0x38);
  *(undefined4 *)this = 2;
  puVar4[8] = 0;
  puVar4[9] = 0;
  puVar4[10] = 0;
  puVar4[3] = 0;
  puVar4[4] = 0;
  puVar4[5] = 0;
  puVar4[6] = 0;
  puVar4[7] = 0;
  puVar4[2] = 0;
  *(undefined1 *)(puVar4 + 0xc) = 0;
  *(undefined1 *)((int)puVar4 + 0x31) = 0;
  puVar4[0xb] = 0;
  *puVar4 = &PTR__InfectedChangePosture_00d219e8;
  puVar4[1] = &PTR__InfectedChangePosture_00d21b4c;
  puVar4[0xd] = 0;
  *(undefined4 **)(this + 4) = puVar4;
  *(undefined4 *)(param_1 + 0x20) = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  *(undefined4 *)(param_1 + 0x28) = 0;
  *(undefined4 *)(param_1 + 0x2c) = 0;
  *(undefined4 *)(this + 8) = 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)