L L4D2node

InfectedWander::OnContact

0x00a39430 · 1093 bytes · __thiscall

_ZN14InfectedWander9OnContactEP8InfectedP11CBaseEntityP10CGameTrace

Decompiled

undefined (4 params)

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

InfectedWander * __thiscall
InfectedWander::OnContact
          (InfectedWander *this,Infected *param_1,CBaseEntity *param_2,CGameTrace *param_3)

{
  undefined4 uVar1;
  char cVar2;
  int iVar3;
  InfectedAttack *this_00;
  int *piVar4;
  int *piVar5;
  undefined4 *puVar6;
  undefined4 *puVar7;
  CBaseEntity *pCVar8;
  longdouble lVar9;
  
  if ((param_3 != (CGameTrace *)0x0) &&
     (cVar2 = (**(code **)(*(int *)param_3 + 300))(param_3), cVar2 != '\0')) {
    cVar2 = (**(code **)(*(int *)param_3 + 0x16c))(param_3);
    if (cVar2 != '\0') {
      cVar2 = (**(code **)(*(int *)param_3 + 0x16c))(param_3);
      pCVar8 = (CBaseEntity *)0x0;
      if (cVar2 != '\0') {
        pCVar8 = (CBaseEntity *)param_3;
      }
      iVar3 = CBaseEntity::GetTeamNumber(pCVar8);
      cVar2 = IsASurvivorTeam(iVar3);
      if (cVar2 != '\0') {
        if (((byte)param_2[0x1c75] & 4) == 0) {
          cVar2 = (**(code **)(*(int *)param_2 + 0x58c))(param_2);
          if (cVar2 == '\0') goto LAB_00a39452;
          this_00 = ::operator_new(0x48);
                    /* try { // try from 00a394fb to 00a394ff has its CatchHandler @ 00a398c9 */
          InfectedAttack::InfectedAttack(this_00,pCVar8);
        }
        else {
          this_00 = ::operator_new(0x481c);
          *(undefined4 *)(this_00 + 0x20) = 0;
          *(undefined4 *)(this_00 + 0x24) = 0;
          *(undefined4 *)(this_00 + 0x28) = 0;
          *(undefined4 *)(this_00 + 0xc) = 0;
          *(undefined4 *)(this_00 + 0x10) = 0;
          *(undefined4 *)(this_00 + 0x14) = 0;
          *(undefined4 *)(this_00 + 0x18) = 0;
          *(undefined4 *)(this_00 + 0x1c) = 0;
          *(undefined4 *)(this_00 + 8) = 0;
          this_00[0x30] = (InfectedAttack)0x0;
          this_00[0x31] = (InfectedAttack)0x0;
          *(undefined4 *)(this_00 + 0x2c) = 0;
          *(undefined ***)this_00 = &PTR__InfectedFlee_00d240a8;
          *(undefined ***)(this_00 + 4) = &PTR__InfectedFlee_00d2420c;
                    /* try { // try from 00a39830 to 00a39834 has its CatchHandler @ 00a398af */
          PathFollower::PathFollower((PathFollower *)(this_00 + 0x34));
        }
LAB_00a39500:
        *(undefined4 *)this = 1;
        *(InfectedAttack **)(this + 4) = this_00;
        *(undefined4 *)(this + 8) = 0;
        *(undefined4 *)(this + 0xc) = 1;
        return this;
      }
      puVar6 = ::operator_new(0x48);
      puVar6[8] = 0;
      puVar6[9] = 0;
      puVar6[10] = 0;
      puVar6[3] = 0;
      puVar6[4] = 0;
      puVar6[5] = 0;
      puVar6[6] = 0;
      puVar6[7] = 0;
      puVar6[2] = 0;
      *(undefined1 *)(puVar6 + 0xc) = 0;
      *(undefined1 *)((int)puVar6 + 0x31) = 0;
      puVar6[0xb] = 0;
      *puVar6 = &PTR__InfectedShoved_00d21b88;
      puVar6[1] = &PTR__InfectedShoved_00d21cec;
      puVar6[0xd] = 0xffffffff;
                    /* try { // try from 00a397a5 to 00a397b7 has its CatchHandler @ 00a398ad */
      puVar7 = (undefined4 *)(**(code **)(*(int *)param_3 + 0xc))(param_3);
      puVar6[0xd] = *puVar7;
      puVar7 = (undefined4 *)(**(code **)(*(int *)param_3 + 0x288))(param_3);
LAB_00a396e8:
      puVar6[0xe] = *puVar7;
      puVar6[0xf] = puVar7[1];
      uVar1 = puVar7[2];
      puVar6[0x11] = 0;
      puVar6[0x10] = uVar1;
      *(undefined4 *)this = 2;
      *(undefined4 **)(this + 4) = puVar6;
      *(undefined4 *)(this + 8) = 0;
      *(undefined4 *)(this + 0xc) = 1;
      return this;
    }
    piVar4 = (int *)__dynamic_cast(param_3,&CBaseEntity::typeinfo,&INextBot::typeinfo,0xfffffffe);
    if (piVar4 != (int *)0x0) {
      piVar5 = (int *)(**(code **)(*piVar4 + 0xc4))(piVar4);
      iVar3 = (**(code **)(*piVar4 + 0xb4))(piVar4);
      if (((*(byte *)(iVar3 + 0x153) & 8) != 0) ||
         ((piVar5 != (int *)0x0 && (cVar2 = (**(code **)(*piVar5 + 0x114))(piVar5,2), cVar2 != '\0')
          ))) {
        puVar6 = ::operator_new(0x48);
        puVar6[8] = 0;
        puVar6[9] = 0;
        puVar6[10] = 0;
        puVar6[3] = 0;
        puVar6[4] = 0;
        puVar6[5] = 0;
        puVar6[6] = 0;
        puVar6[7] = 0;
        puVar6[2] = 0;
        *(undefined1 *)(puVar6 + 0xc) = 0;
        *(undefined1 *)((int)puVar6 + 0x31) = 0;
        puVar6[0xb] = 0;
        *puVar6 = &PTR__InfectedShoved_00d21b88;
        puVar6[1] = &PTR__InfectedShoved_00d21cec;
        puVar6[0xd] = 0xffffffff;
                    /* try { // try from 00a396d5 to 00a396e7 has its CatchHandler @ 00a39893 */
        puVar7 = (undefined4 *)(**(code **)(*(int *)param_3 + 0xc))(param_3);
        puVar6[0xd] = *puVar7;
        puVar7 = (undefined4 *)(**(code **)(*(int *)param_3 + 0x288))(param_3);
        goto LAB_00a396e8;
      }
      lVar9 = (longdouble)CountdownTimer::Now();
      if (*(float *)(param_1 + 0x70) <= (float)lVar9) {
        iVar3 = RandomInt(0,100);
        if ((iVar3 < *(int *)(ZombieBrawlChance._28_4_ + 0x30)) &&
           (iVar3 = __dynamic_cast(piVar4,&INextBot::typeinfo,&Witch::typeinfo,0x1a3c), iVar3 == 0))
        {
          pCVar8 = (CBaseEntity *)(**(code **)(*piVar4 + 0xb4))(piVar4);
          this_00 = ::operator_new(0x48);
                    /* try { // try from 00a39889 to 00a3988d has its CatchHandler @ 00a398db */
          InfectedAttack::InfectedAttack(this_00,pCVar8);
          goto LAB_00a39500;
        }
        lVar9 = (longdouble)CountdownTimer::Now();
        if ((float)lVar9 + 3.0 != *(float *)(param_1 + 0x70)) {
          (**(code **)(*(int *)(param_1 + 0x68) + 4))(param_1 + 0x68,param_1 + 0x70);
          *(float *)(param_1 + 0x70) = (float)lVar9 + 3.0;
        }
        if (*(float *)(param_1 + 0x6c) != 3.0) {
          (**(code **)(*(int *)(param_1 + 0x68) + 4))(param_1 + 0x68,param_1 + 0x6c);
          *(undefined4 *)(param_1 + 0x6c) = 0x40400000;
        }
      }
    }
  }
LAB_00a39452:
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  *(undefined4 *)(this + 0xc) = 1;
  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)