L L4D2node

CBaseCombatCharacter::FindHealthItem

0x005f4860 · 364 bytes · __thiscall

_ZN20CBaseCombatCharacter14FindHealthItemERK6VectorS2_

Decompiled

undefined (3 params)

/* CBaseCombatCharacter::FindHealthItem(Vector const&, Vector const&) */

CBaseEntity * __thiscall
CBaseCombatCharacter::FindHealthItem(CBaseCombatCharacter *this,Vector *param_1,Vector *param_2)

{
  char cVar1;
  int iVar2;
  CBaseEntity *pCVar3;
  int iVar4;
  float local_1048;
  float local_1044;
  float local_1040;
  float local_103c;
  float local_1038;
  float local_1034;
  CFlaggedEntitiesEnum local_1030 [20];
  CBaseEntity *local_101c [1027];
  
  local_103c = *(float *)param_2 + *(float *)param_1;
  local_1048 = *(float *)param_1 - *(float *)param_2;
  local_1038 = *(float *)(param_2 + 4) + *(float *)(param_1 + 4);
  local_1044 = *(float *)(param_1 + 4) - *(float *)(param_2 + 4);
  local_1034 = *(float *)(param_2 + 8) + *(float *)(param_1 + 8);
  local_1040 = *(float *)(param_1 + 8) - *(float *)(param_2 + 8);
  CFlaggedEntitiesEnum::CFlaggedEntitiesEnum(local_1030,local_101c,0x400,0);
  iVar4 = 0;
  iVar2 = UTIL_EntitiesInBox((Vector *)&local_1048,(Vector *)&local_103c,local_1030);
  if (0 < iVar2) {
    do {
      pCVar3 = local_101c[iVar4];
      if ((((pCVar3 != (CBaseEntity *)0x0) &&
           (pCVar3 = (CBaseEntity *)__dynamic_cast(pCVar3,&CBaseEntity::typeinfo,&CItem::typeinfo,0)
           , pCVar3 != (CBaseEntity *)0x0)) &&
          ((*(char **)(pCVar3 + 0x7c) == "item_health*" ||
           (cVar1 = CBaseEntity::ClassMatchesComplex(pCVar3,"item_health*"), cVar1 != '\0')))) &&
         (cVar1 = (**(code **)(*(int *)this + 0x264))(this,pCVar3,0x4041,0), cVar1 != '\0')) {
        return pCVar3;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 != iVar2);
  }
  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)