L L4D2node

CTraceFilterGroundEntities::ShouldHitEntity

0x00745140 · 670 bytes · __thiscall

_ZN26CTraceFilterGroundEntities15ShouldHitEntityEP13IHandleEntityi

Decompiled

undefined (3 params)

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

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

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

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)