L L4D2node

InfectedStaggerAround::OnContact

0x00a37fc0 · 506 bytes · __cdecl

_ZN21InfectedStaggerAround9OnContactEP8InfectedP11CBaseEntityP10CGameTrace

Decompiled

undefined (3 params)

/* InfectedStaggerAround::OnContact(Infected*, CBaseEntity*, CGameTrace*) */

Infected *
InfectedStaggerAround::OnContact(Infected *param_1,CBaseEntity *param_2,CGameTrace *param_3)

{
  char cVar1;
  CBaseEntity *this;
  int iVar2;
  undefined4 *puVar3;
  undefined4 uVar4;
  InfectedAlert *pIVar5;
  InfectedLeanOnWall *this_00;
  int *in_stack_00000010;
  CGameTrace *in_stack_00000014;
  
  if ((in_stack_00000010 != (int *)0x0) &&
     ((in_stack_00000014 == (CGameTrace *)0x0 || (in_stack_00000014[0x37] == (CGameTrace)0x0)))) {
    this = (CBaseEntity *)(**(code **)(*in_stack_00000010 + 0x144))();
    if (this != (CBaseEntity *)0x0) {
      iVar2 = CBaseEntity::GetTeamNumber(this);
      cVar1 = IsASurvivorTeam(iVar2);
      if ((cVar1 != '\0') &&
         (cVar1 = (**(code **)(*(int *)param_3 + 0x58c))(param_3), cVar1 != '\0')) {
        uVar4 = (**(code **)(*(int *)this + 0x288))(this);
        pIVar5 = ::operator_new(0x80);
                    /* try { // try from 00a38163 to 00a38167 has its CatchHandler @ 00a381c4 */
        InfectedAlert::InfectedAlert(pIVar5,uVar4,0);
        *(undefined4 *)param_1 = 1;
        *(InfectedAlert **)(param_1 + 4) = pIVar5;
        *(undefined4 *)(param_1 + 8) = 0;
        *(undefined4 *)(param_1 + 0xc) = 1;
        return param_1;
      }
    }
    if (param_2[0x31] == (CBaseEntity)0x0) {
      if ((*(float *)(in_stack_00000014 + 0x20) <= 0.1 &&
           *(float *)(in_stack_00000014 + 0x20) != 0.1) && (in_stack_00000010 == g_WorldEntity)) {
        this_00 = ::operator_new(0x54);
        InfectedLeanOnWall::InfectedLeanOnWall(this_00,in_stack_00000014);
        *(undefined4 *)param_1 = 2;
        *(InfectedLeanOnWall **)(param_1 + 4) = this_00;
        *(char **)(param_1 + 8) = "Bumped into a wall";
        *(undefined4 *)(param_1 + 0xc) = 1;
        return param_1;
      }
      puVar3 = ::operator_new(0x4c);
      *(undefined4 *)param_1 = 2;
      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__InfectedStandingActivity_00d24c08;
      puVar3[1] = &PTR__InfectedStandingActivity_00d24d6c;
      puVar3[0xe] = &PTR_NetworkStateChanged_00c0b6e0;
      puVar3[0xf] = 0;
      puVar3[0x10] = 0xbf800000;
      puVar3[0xd] = 0x24c;
      puVar3[0x11] = 0;
      *(undefined1 *)(puVar3 + 0x12) = 0;
      *(undefined4 **)(param_1 + 4) = puVar3;
      *(char **)(param_1 + 8) = "Bumped into something";
      *(undefined4 *)(param_1 + 0xc) = 1;
      return param_1;
    }
  }
  *(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 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)