L L4D2node

CEnvGunfire::UpdateTarget

0x00673650 · 366 bytes · __thiscall

_ZN11CEnvGunfire12UpdateTargetEv

Decompiled

undefined (1 param)

/* CEnvGunfire::UpdateTarget() */

void __thiscall CEnvGunfire::UpdateTarget(CEnvGunfire *this)

{
  uint uVar1;
  float *pfVar2;
  undefined *puVar3;
  int *piVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  
  uVar1 = *(uint *)(this + 0x48c);
  if (((((uVar1 != 0xffffffff) &&
        (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar3 + 8) == uVar1 >> 0xc)) &&
      (piVar4 = *(int **)(puVar3 + 4), piVar4 != (int *)0x0)) &&
     (((pfVar2 = (float *)(**(code **)(*piVar4 + 0x288))(piVar4),
       *(float *)(this + 0x474) != *pfVar2 || (*(float *)(this + 0x478) != pfVar2[1])) ||
      (*(float *)(this + 0x47c) != pfVar2[2])))) {
    uVar1 = *(uint *)(this + 0x48c);
    piVar4 = (int *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar3 + 8) == uVar1 >> 0xc)) {
      piVar4 = *(int **)(puVar3 + 4);
    }
    pfVar2 = (float *)(**(code **)(*piVar4 + 0x288))(piVar4);
    fVar5 = *pfVar2;
    *(float *)(this + 0x474) = fVar5;
    fVar6 = pfVar2[1];
    *(float *)(this + 0x478) = fVar6;
    fVar7 = pfVar2[2];
    *(float *)(this + 0x47c) = fVar7;
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
      fVar5 = *(float *)(this + 0x474);
      fVar6 = *(float *)(this + 0x478);
      fVar7 = *(float *)(this + 0x47c);
    }
    *(float *)(this + 0x480) =
         SQRT((*(float *)(this + 0x2e4) - fVar6) * (*(float *)(this + 0x2e4) - fVar6) +
              (*(float *)(this + 0x2e0) - fVar5) * (*(float *)(this + 0x2e0) - fVar5) +
              (*(float *)(this + 0x2e8) - fVar7) * (*(float *)(this + 0x2e8) - fVar7));
    return;
  }
  return;
}

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)