L L4D2node

UTIL_PointAtEntity

0x00b2e730 · 231 bytes · __cdecl

_Z18UTIL_PointAtEntityP11CBaseEntityS0_

Decompiled

undefined (2 params)

/* UTIL_PointAtEntity(CBaseEntity*, CBaseEntity*) */

undefined4 UTIL_PointAtEntity(CBaseEntity *param_1,CBaseEntity *param_2)

{
  CBaseEntity CVar1;
  float local_34;
  float local_30;
  float local_2c;
  QAngle local_28 [24];
  
  if ((param_1 != (CBaseEntity *)0x0) && (param_2 != (CBaseEntity *)0x0)) {
    if (((byte)param_1[0x14d] & 8) == 0) {
      CVar1 = param_2[0x14d];
    }
    else {
      CBaseEntity::CalcAbsolutePosition(param_1);
      CVar1 = param_2[0x14d];
    }
    if (((byte)CVar1 & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(param_2);
    }
    local_34 = *(float *)(param_2 + 0x2e0) - *(float *)(param_1 + 0x2e0);
    local_30 = *(float *)(param_2 + 0x2e4) - *(float *)(param_1 + 0x2e4);
    local_2c = *(float *)(param_2 + 0x2e8) - *(float *)(param_1 + 0x2e8);
    VectorNormalize((Vector *)&local_34);
    VectorAngles((Vector *)&local_34,local_28);
    CBaseEntity::SetLocalAngles(param_1,local_28);
    CBaseEntity::SetAbsAngles(param_1,local_28);
    return 1;
  }
  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)