L L4D2node

CNavArea::ComputeLighting

0x00703fd0 · 378 bytes · __thiscall

_ZN8CNavArea15ComputeLightingEv

Decompiled

undefined (1 param)

/* CNavArea::ComputeLighting() */

char __thiscall CNavArea::ComputeLighting(CNavArea *this)

{
  char cVar1;
  int iVar2;
  longdouble lVar3;
  float fVar4;
  float fVar5;
  float local_44;
  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;
  
  cVar1 = (**(code **)(*engine + 8))(engine);
  if (cVar1 != '\0') {
    *(undefined4 *)(this + 0xdc) = 0x3f800000;
    *(undefined4 *)(this + 0xe0) = 0x3f800000;
    *(undefined4 *)(this + 0xe4) = 0x3f800000;
    *(undefined4 *)(this + 0xe8) = 0x3f800000;
    this[0x3b] = (CNavArea)0xff;
    return cVar1;
  }
  iVar2 = 0;
  do {
    FindPositionInArea((Vector *)&local_40,this,iVar2);
    lVar3 = (longdouble)GetZ(this,local_40,local_3c);
    local_38 = (float)lVar3 + 17.5;
    cVar1 = CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_40,&local_44,(Vector *)0x0);
    if (cVar1 != '\0') {
      local_38 = local_44 + 17.5;
    }
    cVar1 = (**(code **)(*engine + 0x194))(engine,(Vector *)&local_40,0,&local_34);
    if (cVar1 == '\0') {
      return '\0';
    }
    cVar1 = GetTerrainAmbientLightAtPoint
                      ((Vector *)&local_40,(Vector *)&local_28,(CBaseAnimating *)0x0);
    if (cVar1 == '\0') {
      return '\0';
    }
    fVar4 = local_30 + local_34 + local_2c;
    fVar5 = local_24 + local_28 + local_20;
    if (fVar4 <= 0.0) {
      fVar4 = 0.0;
    }
    if (1.0 <= fVar4) {
      fVar4 = 1.0;
    }
    if (fVar4 <= fVar5) {
      fVar4 = fVar5;
    }
    *(float *)(this + iVar2 * 4 + 0xdc) = fVar4;
    iVar2 = iVar2 + 1;
  } while (iVar2 != 4);
  RecomputeAverageLightIntensity(this);
  return cVar1;
}

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)