L L4D2node

CPathKeyFrame::CalculateFrameDuration

0x006f7c20 · 291 bytes · __thiscall

_ZN13CPathKeyFrame22CalculateFrameDurationEv

Decompiled

undefined (1 param)

/* CPathKeyFrame::CalculateFrameDuration() */

void __thiscall CPathKeyFrame::CalculateFrameDuration(CPathKeyFrame *this)

{
  int iVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  float local_18;
  float local_14;
  float local_10;
  
  iVar1 = *(int *)(this + 0x470);
  if ((iVar1 != 0) && (0.0 < *(float *)(this + 0x478))) {
    fVar4 = *(float *)(this + 0x440) - *(float *)(iVar1 + 0x440);
    fVar2 = *(float *)(this + 0x448) - *(float *)(iVar1 + 0x448);
    fVar3 = *(float *)(this + 0x444) - *(float *)(iVar1 + 0x444);
    fVar2 = SQRT(fVar2 * fVar2 + fVar4 * fVar4 + fVar3 * fVar3) / *(float *)(this + 0x478);
    *(float *)(this + 0x46c) = fVar2;
    if (fVar2 == 0.0) {
      local_18 = *(float *)(this + 0x44c) - *(float *)(iVar1 + 0x44c);
      local_14 = *(float *)(this + 0x450) - *(float *)(iVar1 + 0x450);
      local_10 = *(float *)(this + 0x454) - *(float *)(iVar1 + 0x454);
      FixupAngles((QAngle *)&local_18);
      fVar2 = ABS(local_18);
      if (ABS(local_18) <= 0.0) {
        fVar2 = 0.0;
      }
      if (fVar2 <= ABS(local_14)) {
        fVar2 = ABS(local_14);
      }
      if (fVar2 <= ABS(local_10)) {
        fVar2 = ABS(local_10);
      }
      *(float *)(this + 0x46c) = fVar2 / *(float *)(this + 0x478);
      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)