L L4D2node

CTraceFilterWalkableEntities::ShouldHitEntity

0x00706530 · 538 bytes · __thiscall

_ZN28CTraceFilterWalkableEntities15ShouldHitEntityEP13IHandleEntityi

Decompiled

undefined (3 params)

/* CTraceFilterWalkableEntities::ShouldHitEntity(IHandleEntity*, int) */

uint __thiscall
CTraceFilterWalkableEntities::ShouldHitEntity
          (CTraceFilterWalkableEntities *this,IHandleEntity *param_1,int param_2)

{
  uint uVar1;
  int iVar2;
  char cVar3;
  uint uVar4;
  CBaseEntity *this_00;
  
  uVar4 = CTraceFilterNoNPCsOrPlayer::ShouldHitEntity
                    ((CTraceFilterNoNPCsOrPlayer *)this,param_1,param_2);
  if ((char)uVar4 == '\0') {
    return uVar4;
  }
  cVar3 = (**(code **)(*staticpropmgr + 8))(staticpropmgr,param_1);
  this_00 = (CBaseEntity *)0x0;
  if (cVar3 == '\0') {
    this_00 = (CBaseEntity *)param_1;
  }
  uVar1 = *(uint *)(this + 0x10);
  if (*(char **)(this_00 + 0x7c) == "worldspawn") {
    return uVar4;
  }
  cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"worldspawn");
  if (cVar3 != '\0') {
    return uVar4;
  }
  if (*(char **)(this_00 + 0x7c) != "player") {
    cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"player");
    if (cVar3 != '\0') {
      return uVar4;
    }
    if ((*(char **)(this_00 + 0x7c) == "func_door*") ||
       (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"func_door*"), cVar3 != '\0')) {
      return (uVar1 >> 1 ^ 1) & 1;
    }
    if ((*(char **)(this_00 + 0x7c) == "prop_door*") ||
       (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"prop_door*"), cVar3 != '\0')) {
      return uVar1 & 1 ^ 1;
    }
    if ((*(char **)(this_00 + 0x7c) == "func_brush") ||
       (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"func_brush"), cVar3 != '\0')) {
      iVar2 = *(int *)(this_00 + 0x440);
      if (iVar2 == 1) {
        return 0;
      }
      if (iVar2 == 2) {
        return uVar4;
      }
      if (iVar2 == 0) {
        return (uVar1 >> 3 ^ 1) & 1;
      }
    }
    if (((((*(char **)(this_00 + 0x7c) == "func_breakable") ||
          (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"func_breakable"), cVar3 != '\0')) &&
         (*(int *)(this_00 + 0x100) != 0)) && (this_00[0x105] == (CBaseEntity)0x2)) ||
       (((*(char **)(this_00 + 0x7c) == "func_breakable_surf" ||
         (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"func_breakable_surf"), cVar3 != '\0'))
        && (this_00[0x105] == (CBaseEntity)0x2)))) {
      return (uVar1 >> 2 ^ 1) & 1;
    }
    if ((*(char **)(this_00 + 0x7c) != "func_playerinfected_clip") &&
       (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"func_playerinfected_clip"), cVar3 == '\0')
       ) {
      if (*(int *)(nav_solid_props._28_4_ + 0x30) == 0) {
        return uVar4;
      }
      if ((*(char **)(this_00 + 0x7c) != "prop_*") &&
         (cVar3 = CBaseEntity::ClassMatchesComplex(this_00,"prop_*"), cVar3 == '\0')) {
        return uVar4;
      }
    }
    return 0;
  }
  return uVar4;
}

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)