L L4D2node

CTerrorMeleeWeapon::ShouldHitEntity

0x005691f0 · 106 bytes · __thiscall

_ZN18CTerrorMeleeWeapon15ShouldHitEntityEP11CBaseEntity

Decompiled

undefined (2 params)

/* CTerrorMeleeWeapon::ShouldHitEntity(CBaseEntity*) */

bool __thiscall CTerrorMeleeWeapon::ShouldHitEntity(CTerrorMeleeWeapon *this,CBaseEntity *param_1)

{
  char cVar1;
  int iVar2;
  
  if (param_1 != (CBaseEntity *)0x0) {
    iVar2 = CBaseEntity::GetTeamNumber(param_1);
    cVar1 = IsASurvivorTeam(iVar2);
    if ((cVar1 != '\0') && (cVar1 = (**(code **)(*(int *)param_1 + 0x16c))(param_1), cVar1 != '\0'))
    {
      if (*(float *)(this + 0x1828) < 0.4) {
        return false;
      }
      if (0.6 < *(float *)(this + 0x1828)) {
        return false;
      }
    }
  }
  return *(int *)(param_1 + 0x234) != 0xb;
}

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)