L L4D2node

CBaseCombatCharacter::FindMissTarget

0x005f0470 · 531 bytes · __thiscall

_ZN20CBaseCombatCharacter14FindMissTargetEv

Decompiled

undefined (1 param)

/* CBaseCombatCharacter::FindMissTarget() */

CBaseEntity * __thiscall CBaseCombatCharacter::FindMissTarget(CBaseCombatCharacter *this)

{
  char cVar1;
  int *piVar2;
  int iVar3;
  CBaseEntity *pCVar4;
  int iVar5;
  int local_480;
  float local_474;
  float local_470;
  float local_46c;
  float local_468;
  float local_464;
  float local_460;
  CFlaggedEntitiesEnum local_45c [64];
  CBaseEntity *local_41c [259];
  
  piVar2 = (int *)UTIL_GetLocalPlayer();
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_468 = *(float *)(this + 0x2e0) + 100.0;
  local_474 = *(float *)(this + 0x2e0) - 100.0;
  local_470 = *(float *)(this + 0x2e4) - 100.0;
  local_464 = *(float *)(this + 0x2e4) + 100.0;
  local_46c = *(float *)(this + 0x2e8) - 100.0;
  local_460 = *(float *)(this + 0x2e8) + 100.0;
  CFlaggedEntitiesEnum::CFlaggedEntitiesEnum(local_45c,local_41c,0x100,0);
  iVar5 = 0;
  iVar3 = UTIL_EntitiesInBox((Vector *)&local_474,(Vector *)&local_468,local_45c);
  local_480 = 0;
  if (0 < iVar3) {
    do {
      while ((pCVar4 = local_41c[iVar5], pCVar4 == (CBaseEntity *)0x0 ||
             ((piVar2 != (int *)0x0 &&
              (cVar1 = (**(code **)(*piVar2 + 0x3c8))(piVar2,pCVar4), cVar1 == '\0'))))) {
LAB_005f05c8:
        iVar5 = iVar5 + 1;
        if (iVar5 == iVar3) goto LAB_005f062b;
      }
      if (0xf < local_480) goto LAB_005f0635;
      pCVar4 = local_41c[iVar5];
      if (*(char **)(pCVar4 + 0x7c) != "prop_dynamic") {
        cVar1 = CBaseEntity::ClassMatchesComplex(pCVar4,"prop_dynamic");
        pCVar4 = local_41c[iVar5];
        if ((cVar1 == '\0') && (*(char **)(pCVar4 + 0x7c) != "prop_physics")) {
          cVar1 = CBaseEntity::ClassMatchesComplex(pCVar4,"prop_physics");
          pCVar4 = local_41c[iVar5];
          if ((cVar1 == '\0') && (*(char **)(pCVar4 + 0x7c) != "physics_prop")) {
            cVar1 = CBaseEntity::ClassMatchesComplex(pCVar4,"physics_prop");
            if (cVar1 == '\0') goto LAB_005f05c8;
            pCVar4 = local_41c[iVar5];
          }
        }
      }
      iVar5 = iVar5 + 1;
      local_41c[local_480 + -0x10] = pCVar4;
      local_480 = local_480 + 1;
    } while (iVar5 != iVar3);
LAB_005f062b:
    if (local_480 != 0) {
LAB_005f0635:
      iVar3 = (**(code **)(*random_valve + 8))(random_valve,0,local_480 + -1);
      return local_41c[iVar3 + -0x10];
    }
  }
  return (CBaseEntity *)0x0;
}

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)