L L4D2node

ZombieBotLocomotion::FaceTowards

0x00a51230 · 279 bytes · __thiscall

_ZN19ZombieBotLocomotion11FaceTowardsERK6Vector

Decompiled

undefined (2 params)

/* ZombieBotLocomotion::FaceTowards(Vector const&) */

void __thiscall ZombieBotLocomotion::FaceTowards(ZombieBotLocomotion *this,Vector *param_1)

{
  int iVar1;
  float fVar2;
  float *pfVar3;
  longdouble lVar4;
  longdouble lVar5;
  longdouble lVar6;
  float fVar7;
  undefined4 local_24;
  float local_20;
  undefined4 local_1c;
  float local_18;
  float local_14;
  float local_10;
  
  iVar1 = *(int *)(this + 0x78);
  fVar7 = *(float *)(this + 8);
  local_24 = *(undefined4 *)(iVar1 + 0x3a8);
  local_20 = *(float *)(iVar1 + 0x3ac);
  local_1c = *(undefined4 *)(iVar1 + 0x3b0);
  pfVar3 = (float *)(**(code **)(*(int *)this + 300))(this);
  local_18 = *(float *)param_1 - *pfVar3;
  local_14 = *(float *)(param_1 + 4) - pfVar3[1];
  local_10 = *(float *)(param_1 + 8) - pfVar3[2];
  lVar4 = (longdouble)UTIL_VecToYaw((Vector *)&local_18);
  lVar5 = (longdouble)AngleDiff((float)lVar4,local_20);
  lVar6 = (longdouble)(**(code **)(*(int *)this + 0x184))(this);
  fVar7 = (float)lVar6 * fVar7;
  if ((float)lVar5 < -fVar7) {
    fVar2 = local_20 - fVar7;
  }
  else {
    fVar2 = (float)lVar4;
    if (fVar7 < (float)lVar5) {
      fVar2 = fVar7 + local_20;
    }
  }
  local_20 = fVar2;
  CBaseEntity::SetLocalAngles(*(CBaseEntity **)(this + 0x78),(QAngle *)&local_24);
  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)