L L4D2node

SurvivorBehavior::OnContact

0x00926850 · 703 bytes · __thiscall

_ZN16SurvivorBehavior9OnContactEP11SurvivorBotP11CBaseEntityP10CGameTrace

Decompiled

undefined (4 params)

/* SurvivorBehavior::OnContact(SurvivorBot*, CBaseEntity*, CGameTrace*) */

SurvivorBehavior * __thiscall
SurvivorBehavior::OnContact
          (SurvivorBehavior *this,SurvivorBot *param_1,CBaseEntity *param_2,CGameTrace *param_3)

{
  float fVar1;
  code *pcVar2;
  char cVar3;
  int *piVar4;
  CBaseEntity *pCVar5;
  int *piVar6;
  undefined4 uVar7;
  CTakeDamageInfo local_7c [108];
  
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x9a4))(param_2);
  if (param_3 == (CGameTrace *)0x0) goto LAB_00926917;
  if ((*(byte *)(gpGlobals + 4) & 1) != 0) {
    cVar3 = (**(code **)(*(int *)param_2 + 0x6e4))(param_2,param_3,0);
    if (cVar3 != '\0') {
      if (*(char **)(param_3 + 0x7c) != "prop_door*") {
        cVar3 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)param_3,"prop_door*");
        if ((cVar3 == '\0') && (*(char **)(param_3 + 0x7c) != "func_door*")) {
          cVar3 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)param_3,"func_door*");
          if (cVar3 == '\0') goto LAB_00926889;
        }
      }
      piVar6 = (int *)__dynamic_cast(param_3,&CBaseEntity::typeinfo,&CBasePropDoor::typeinfo,0);
      if (piVar6 == (int *)0x0) {
        piVar6 = (int *)__dynamic_cast(param_3,&CBaseEntity::typeinfo,&CBaseDoor::typeinfo,0);
        if (piVar6 == (int *)0x0) goto LAB_00926917;
        if ((char)piVar6[0x13f] != '\0') goto LAB_00926a88;
      }
      else {
        if ((char)piVar6[0x589] != '\0') {
LAB_00926a88:
          (**(code **)(*(int *)param_2 + 0x948))(param_2,0xbf800000);
          goto LAB_00926917;
        }
        if (piVar6[0x57d] - 1U < 3) goto LAB_00926917;
      }
      pcVar2 = *(code **)(*piVar4 + 0xc0);
      uVar7 = (**(code **)(*piVar6 + 0x288))(piVar6);
      (*pcVar2)(piVar4,uVar7,3,0x3f800000,&g_SurvivorBotUseOnReply,"Look at door to open it",1,
                0x3e800000);
      goto LAB_00926917;
    }
  }
LAB_00926889:
  fVar1 = *(float *)(ZombieGunDamage._28_4_ + 0x2c);
  pCVar5 = (CBaseEntity *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)param_2);
  CTakeDamageInfo::CTakeDamageInfo
            (local_7c,param_2,param_2,pCVar5,(Vector *)&vec3_origin,(Vector *)&vec3_origin,fVar1,
             0x80,0,(Vector *)0x0);
  cVar3 = IsBreakableEntity((CBaseEntity *)param_3,false,false,local_7c);
  if (cVar3 != '\0') {
    cVar3 = CDirectorChallengeMode::CanTargetEntity
                      (*(CDirectorChallengeMode **)(TheDirector + 0x648),(CBaseEntity *)param_3);
    if (cVar3 != '\0') {
      pcVar2 = *(code **)(*piVar4 + 0xc0);
      uVar7 = (**(code **)(*(int *)param_3 + 0x288))(param_3);
      (*pcVar2)(piVar4,uVar7,3,0x3f800000,&g_SurvivorBotMeleeOnReply,
                "Melee smash breakable in our way",1,0x3e800000);
    }
  }
LAB_00926917:
  *(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)