L L4D2node

CEnvEntityMaker::IsPlayerLooking

0x006904a0 · 274 bytes · __thiscall

_ZN15CEnvEntityMaker15IsPlayerLookingEv

Decompiled

undefined (1 param)

/* CEnvEntityMaker::IsPlayerLooking() */

undefined4 __thiscall CEnvEntityMaker::IsPlayerLooking(CEnvEntityMaker *this)

{
  int iVar1;
  code *pcVar2;
  int *piVar3;
  int iVar4;
  int *piVar5;
  int *piVar6;
  int aiStack_68 [6];
  int *local_50;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  iVar4 = 1;
  piVar6 = aiStack_68 + 3;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      *piVar6 = iVar4;
      piVar6[-1] = 0x690557;
      piVar3 = (int *)UTIL_PlayerByIndex(*piVar6);
      piVar5 = piVar6;
      if (piVar3 != (int *)0x0) {
        iVar1 = *piVar3;
        piVar6[1] = (int)piVar3;
        *piVar6 = (int)&local_40;
        pcVar2 = *(code **)(iVar1 + 0x3fc);
        piVar6[-1] = 0x69056d;
        local_50 = piVar3;
        (*pcVar2)();
        iVar1 = *local_50;
        *piVar6 = (int)local_50;
        piVar6[-1] = (int)&local_28;
        pcVar2 = *(code **)(iVar1 + 0x234);
        piVar6[-2] = 0x690585;
        (*pcVar2)();
        piVar5 = piVar6 + -2;
        if (((byte)this[0x14d] & 8) != 0) {
          piVar6[-2] = (int)this;
          piVar6[-3] = 0x69059d;
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)piVar6[-2]);
        }
        local_34 = *(float *)(this + 0x2e0) - local_28;
        local_30 = *(float *)(this + 0x2e4) - local_24;
        local_2c = *(float *)(this + 0x2e8);
        piVar6[-2] = (int)&local_34;
        local_2c = local_2c - local_20;
        piVar6[-3] = 0x690511;
        VectorNormalize((Vector *)piVar6[-2]);
        if (0.0 < local_30 * local_3c + local_34 * local_40 + local_2c * local_38) {
          return 1;
        }
      }
      iVar4 = iVar4 + 1;
      piVar6 = piVar5;
    } while (iVar4 <= *(int *)(gpGlobals + 0x14));
  }
  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)