L L4D2node

InfectedWander::OnShoved

0x00a398e0 · 1054 bytes · __cdecl

_ZN14InfectedWander8OnShovedEP8InfectedP11CBaseEntity

Decompiled

undefined (2 params)

/* InfectedWander::OnShoved(Infected*, CBaseEntity*) */

Infected * InfectedWander::OnShoved(Infected *param_1,CBaseEntity *param_2)

{
  float fVar1;
  float fVar2;
  float fVar3;
  char cVar4;
  int *piVar5;
  int iVar6;
  undefined4 *puVar7;
  undefined4 *puVar8;
  Infected *in_stack_0000000c;
  CBaseEntity *in_stack_00000010;
  InfectedAlert *local_40;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  if (in_stack_00000010 == (CBaseEntity *)0x0) {
LAB_00a3990e:
    piVar5 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x594))();
    cVar4 = (**(code **)(*piVar5 + 0x100))(piVar5,4);
    if (cVar4 != '\0') {
LAB_00a39934:
      *(undefined4 *)param_1 = 0;
      *(undefined4 *)(param_1 + 4) = 0;
      *(undefined4 *)(param_1 + 8) = 0;
      *(undefined4 *)(param_1 + 0xc) = 1;
      return param_1;
    }
    cVar4 = (**(code **)(*(int *)in_stack_0000000c + 0x58c))();
    if (cVar4 == '\0') {
      local_40 = (InfectedAlert *)0x0;
    }
    else {
      if (((byte)in_stack_00000010[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(in_stack_00000010);
      }
      local_40 = ::operator_new(0x80);
                    /* try { // try from 00a39c1e to 00a39c22 has its CatchHandler @ 00a39d24 */
      InfectedAlert::InfectedAlert(local_40,in_stack_00000010 + 0x2e0,0);
    }
    puVar7 = ::operator_new(0x48);
    puVar7[8] = 0;
    puVar7[9] = 0;
    puVar7[10] = 0;
    puVar7[3] = 0;
    puVar7[4] = 0;
    puVar7[5] = 0;
    puVar7[6] = 0;
    puVar7[7] = 0;
    puVar7[2] = 0;
    *(undefined1 *)(puVar7 + 0xc) = 0;
    *(undefined1 *)((int)puVar7 + 0x31) = 0;
    puVar7[0xb] = 0;
    *puVar7 = &PTR__InfectedShoved_00d21b88;
    puVar7[1] = &PTR__InfectedShoved_00d21cec;
    puVar7[0xd] = 0xffffffff;
    if (in_stack_00000010 == (CBaseEntity *)0x0) {
      puVar7[0xe] = vec3_origin;
      puVar7[0xf] = DAT_01053d4c;
      puVar7[0x10] = DAT_01053d50;
      goto LAB_00a39b75;
    }
                    /* try { // try from 00a39c9c to 00a39cae has its CatchHandler @ 00a39d55 */
    puVar8 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0xc))();
    puVar7[0xd] = *puVar8;
    puVar8 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0x288))();
  }
  else {
    cVar4 = (**(code **)(*(int *)in_stack_00000010 + 0x16c))();
    if ((cVar4 == '\0') || (in_stack_0000000c[0x1d90] != (Infected)0x0)) goto LAB_00a3990e;
    iVar6 = CBaseEntity::GetTeamNumber(in_stack_00000010);
    cVar4 = IsASurvivorTeam(iVar6);
    if (cVar4 == '\0') goto LAB_00a3990e;
    if (((byte)in_stack_0000000c[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)in_stack_0000000c);
    }
    if (((byte)in_stack_00000010[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(in_stack_00000010);
    }
    local_2c = 0.0;
    local_34 = *(float *)(in_stack_00000010 + 0x2e0) - *(float *)(in_stack_0000000c + 0x2e0);
    local_30 = *(float *)(in_stack_00000010 + 0x2e4) - *(float *)(in_stack_0000000c + 0x2e4);
    VectorNormalize((Vector *)&local_34);
    piVar5 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x570))();
    (**(code **)(*piVar5 + 1000))(&local_28,piVar5);
    fVar3 = local_2c;
    fVar2 = local_30;
    fVar1 = local_34;
    piVar5 = (int *)(**(code **)(*(int *)in_stack_0000000c + 0x594))();
    cVar4 = (**(code **)(*piVar5 + 0x100))(piVar5,4);
    if ((cVar4 != '\0') || (local_24 * fVar2 + local_28 * fVar1 + local_20 * fVar3 < -0.7071)) {
      Infected::OnAmbushed(in_stack_0000000c,(CTerrorPlayer *)in_stack_00000010);
      goto LAB_00a39934;
    }
    cVar4 = (**(code **)(*(int *)in_stack_0000000c + 0x58c))();
    if (cVar4 == '\0') {
      local_40 = (InfectedAlert *)0x0;
    }
    else {
      if (((byte)in_stack_00000010[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition(in_stack_00000010);
      }
      local_40 = ::operator_new(0x80);
                    /* try { // try from 00a39acb to 00a39acf has its CatchHandler @ 00a39d53 */
      InfectedAlert::InfectedAlert(local_40,in_stack_00000010 + 0x2e0,0);
    }
    puVar7 = ::operator_new(0x48);
    puVar7[8] = 0;
    puVar7[9] = 0;
    puVar7[10] = 0;
    puVar7[3] = 0;
    puVar7[4] = 0;
    puVar7[5] = 0;
    puVar7[6] = 0;
    puVar7[7] = 0;
    puVar7[2] = 0;
    *(undefined1 *)(puVar7 + 0xc) = 0;
    *(undefined1 *)((int)puVar7 + 0x31) = 0;
    puVar7[0xb] = 0;
    *puVar7 = &PTR__InfectedShoved_00d21b88;
    puVar7[1] = &PTR__InfectedShoved_00d21cec;
    puVar7[0xd] = 0xffffffff;
                    /* try { // try from 00a39b45 to 00a39b57 has its CatchHandler @ 00a39d39 */
    puVar8 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0xc))();
    puVar7[0xd] = *puVar8;
    puVar8 = (undefined4 *)(**(code **)(*(int *)in_stack_00000010 + 0x288))();
  }
  puVar7[0xe] = *puVar8;
  puVar7[0xf] = puVar8[1];
  puVar7[0x10] = puVar8[2];
LAB_00a39b75:
  puVar7[0x11] = local_40;
  *(undefined4 *)param_1 = 2;
  *(undefined4 **)(param_1 + 4) = puVar7;
  *(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)