L L4D2node

CPropMinigun::OnControls

0x00547870 · 332 bytes · __thiscall

_ZN12CPropMinigun10OnControlsEP11CBaseEntity

Decompiled

undefined (2 params)

/* CPropMinigun::OnControls(CBaseEntity*) */

bool __thiscall CPropMinigun::OnControls(CPropMinigun *this,CBaseEntity *param_1)

{
  uint uVar1;
  undefined *puVar2;
  CBaseEntity *pCVar3;
  longdouble extraout_ST0;
  float local_24;
  float local_20;
  undefined4 local_1c;
  QAngle local_18 [4];
  float local_14;
  
  uVar1 = *(uint *)(this + 0x15cc);
  if ((uVar1 == 0xffffffff) ||
     (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 == (undefined *)0xfffffffc)) {
    if (param_1 == (CBaseEntity *)0x0) {
      return true;
    }
  }
  else {
    if (*(uint *)(puVar2 + 8) == uVar1 >> 0xc) {
      pCVar3 = *(CBaseEntity **)(puVar2 + 4);
    }
    else {
      pCVar3 = (CBaseEntity *)0x0;
    }
    if (param_1 == pCVar3) {
      return true;
    }
    if ((*(uint *)(puVar2 + 8) == uVar1 >> 0xc) && (*(int *)(puVar2 + 4) != 0)) {
      return false;
    }
  }
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition(param_1);
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_1c = 0;
  local_24 = *(float *)(this + 0x2e0) - *(float *)(param_1 + 0x2e0);
  local_20 = *(float *)(this + 0x2e4) - *(float *)(param_1 + 0x2e4);
  VectorNormalize((Vector *)&local_24);
  VectorAngles((Vector *)&local_24,local_18);
  AngleNormalize(local_14 - *(float *)(this + 0x15e8));
  return ABS((float)extraout_ST0) <= 45.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)