L L4D2node

CTerrorPlayer::GetLineOfScrimmageDistance

0x009a0680 · 134 bytes · __cdecl

_ZN13CTerrorPlayer26GetLineOfScrimmageDistanceEv

Decompiled

undefined (0 params)

/* CTerrorPlayer::GetLineOfScrimmageDistance() */

longdouble CTerrorPlayer::GetLineOfScrimmageDistance(void)

{
  char cVar1;
  float fVar2;
  
  if (*(int *)(TheDirector + 0x194) - 2U < 2) {
    fVar2 = *(float *)(ZombieGhostLineOfScrimmageFar._28_4_ + 0x2c);
  }
  else {
    fVar2 = *(float *)(ZombieGhostLineOfScrimmageNear._28_4_ + 0x2c);
  }
  cVar1 = CTerrorGameRules::HasPlayerControlledZombies();
  if (cVar1 == '\0') {
    if (0 < *(int *)(TheDirector + 0x1c0)) {
      fVar2 = fVar2 + *(float *)(ZombieGhostLineOfScrimmageThreatBonus._28_4_ + 0x2c);
    }
    if (0 < *(int *)(TheDirector + 0x1bc)) {
      fVar2 = fVar2 + *(float *)(ZombieGhostLineOfScrimmageThreatBonus._28_4_ + 0x2c) * 0.5;
    }
  }
  return (longdouble)fVar2;
}

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)