L L4D2node

SmokerBehavior::OnContact

0x00ac62f0 · 1083 bytes · __cdecl

_ZN14SmokerBehavior9OnContactEP6SmokerP11CBaseEntityP10CGameTrace

Decompiled

undefined (3 params)

/* SmokerBehavior::OnContact(Smoker*, CBaseEntity*, CGameTrace*) */

Smoker * SmokerBehavior::OnContact(Smoker *param_1,CBaseEntity *param_2,CGameTrace *param_3)

{
  code *pcVar1;
  char *pcVar2;
  char cVar3;
  int iVar4;
  int *piVar5;
  undefined4 uVar6;
  float *pfVar7;
  int iVar8;
  bool bVar9;
  CBaseEntity *in_stack_00000010;
  int in_stack_00000014;
  float local_248;
  float local_244;
  float local_240;
  float local_23c;
  float local_238;
  float local_234;
  CFlaggedEntitiesEnum local_230 [20];
  CBaseEntity *local_21c [131];
  
  if (in_stack_00000010 != (CBaseEntity *)0x0) {
    iVar4 = CBaseEntity::GetTeamNumber((CBaseEntity *)param_3);
    bVar9 = false;
    if (iVar4 == 3) {
      iVar4 = (**(code **)(*(int *)param_3 + 0x544))(param_3);
      bVar9 = iVar4 == 8;
    }
    cVar3 = IsBreakableEntity(in_stack_00000010,bVar9,true,(CTakeDamageInfo *)0x0);
    if ((((cVar3 == '\0') && (*(char **)(in_stack_00000010 + 0x7c) != "prop_door*")) &&
        (cVar3 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"prop_door*"), cVar3 == '\0'))
       && ((*(char **)(in_stack_00000010 + 0x7c) != "func_door*" &&
           (cVar3 = CBaseEntity::ClassMatchesComplex(in_stack_00000010,"func_door*"), cVar3 == '\0')
           ))) {
      if (((in_stack_00000014 != 0) && (in_stack_00000010 == g_WorldEntity)) &&
         ((*(float *)(in_stack_00000014 + 0x2c) <= 0.6 &&
           *(float *)(in_stack_00000014 + 0x2c) != 0.6 &&
          (*(float *)(gpGlobals + 0xc) - *(float *)(param_2 + 0x34) < 1.0)))) {
        pfVar7 = (float *)(**(code **)(*(int *)(param_3 + 0x194) + 4))(param_3 + 0x194);
        if (((byte)param_3[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_3);
        }
        local_244 = (*(float *)(param_3 + 0x2e4) - pfVar7[1]) - 36.0;
        local_240 = *(float *)(param_3 + 0x2e8) - pfVar7[2];
        local_248 = (*(float *)(param_3 + 0x2e0) - *pfVar7) - 36.0;
        pfVar7 = (float *)(**(code **)(*(int *)(param_3 + 0x194) + 8))(param_3 + 0x194);
        if (((byte)param_3[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_3);
        }
        local_234 = pfVar7[2] + *(float *)(param_3 + 0x2e8);
        local_238 = *(float *)(param_3 + 0x2e4) + pfVar7[1] + 36.0;
        local_23c = *(float *)(param_3 + 0x2e0) + *pfVar7 + 36.0;
        CFlaggedEntitiesEnum::CFlaggedEntitiesEnum(local_230,local_21c,0x80,0);
        iVar4 = 0;
        iVar8 = UTIL_EntitiesInBox((Vector *)&local_248,(Vector *)&local_23c,local_230);
        if (0 < iVar8) {
          pcVar2 = *(char **)(local_21c[0] + 0x7c);
          do {
            if ((pcVar2 != (char *)0x0) && ((*pcVar2 == 'p' || (*pcVar2 == 'f')))) {
              if (pcVar2 != "prop_door*") {
                cVar3 = CBaseEntity::ClassMatchesComplex(local_21c[0],"prop_door*");
                if (cVar3 == '\0') {
                  local_21c[0] = local_21c[iVar4];
                  if (*(char **)(local_21c[0] + 0x7c) == "func_door*") goto LAB_00ac634e;
                  cVar3 = CBaseEntity::ClassMatchesComplex(local_21c[0],"func_door*");
                  if (cVar3 == '\0') goto LAB_00ac66a0;
                }
                local_21c[0] = local_21c[iVar4];
              }
              goto LAB_00ac634e;
            }
LAB_00ac66a0:
            iVar4 = iVar4 + 1;
            if (iVar4 == iVar8) break;
            local_21c[0] = local_21c[iVar4];
            pcVar2 = *(char **)(local_21c[0] + 0x7c);
          } while( true );
        }
      }
      iVar4 = (**(code **)(*(int *)in_stack_00000010 + 0x144))(in_stack_00000010);
      if (iVar4 != 0) {
        piVar5 = (int *)(**(code **)(*(int *)param_3 + 0x9b4))(param_3);
        pcVar1 = *(code **)(*piVar5 + 0xc0);
        uVar6 = (**(code **)(*(int *)in_stack_00000010 + 0x288))(in_stack_00000010);
        (*pcVar1)(piVar5,uVar6,2,0x3f800000,
                  &OnContact(Smoker*,CBaseEntity*,CGameTrace*)::pressAltFireButton,
                  "Looking at actor I\'m trying to attack",1,0x3e800000);
      }
    }
    else {
      local_21c[0] = in_stack_00000010;
      if (in_stack_00000014 != 0) {
LAB_00ac634e:
        in_stack_00000010 = local_21c[0];
        if (0.8 < *(float *)(in_stack_00000014 + 0x20) ||
            *(float *)(in_stack_00000014 + 0x20) == 0.8) goto LAB_00ac63c4;
      }
      piVar5 = (int *)(**(code **)(*(int *)param_3 + 0x9b4))(param_3);
      pcVar1 = *(code **)(*piVar5 + 0xc0);
      uVar6 = (**(code **)(*(int *)in_stack_00000010 + 0x288))(in_stack_00000010);
      (*pcVar1)(piVar5,uVar6,3,0x3f800000,
                &OnContact(Smoker*,CBaseEntity*,CGameTrace*)::pressAltFireButton,
                "Looking at door I\'m trying to break",1,0x3e800000);
    }
  }
LAB_00ac63c4:
  *(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)