L L4D2node

CBaseMoveBehavior::StartMoving

0x006f7430 · 789 bytes · __thiscall

_ZN17CBaseMoveBehavior11StartMovingEi

Decompiled

undefined (2 params)

/* CBaseMoveBehavior::StartMoving(int) */

undefined4 __thiscall CBaseMoveBehavior::StartMoving(CBaseMoveBehavior *this,int param_1)

{
  int iVar1;
  int iVar2;
  int iVar3;
  float fVar4;
  float fVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  
  if (param_1 == 0) goto LAB_006f7608;
  iVar2 = *(int *)(this + 0x4a4);
  if (iVar2 == param_1) {
    fVar8 = *(float *)(this + 0x2d0);
    iVar1 = *(int *)(this + 0x494);
    if (*(float *)(this + 0x488) <= fVar8) {
      *(int *)(this + 0x490) = iVar1;
      *(undefined4 *)(this + 0x4a0) = 0;
      if (iVar2 == 1) {
        iVar1 = *(int *)(iVar1 + 0x470);
      }
      else if (iVar2 == -1) {
        iVar1 = *(int *)(iVar1 + 0x474);
      }
      if (iVar1 == 0) {
        *(undefined4 *)(this + 0x488) = 0;
        *(undefined4 *)(this + 0x484) = 0;
        (**(code **)(*(int *)this + 0x328))(this);
        return 0;
      }
      *(int *)(this + 0x494) = iVar1;
      goto LAB_006f74ae;
    }
  }
  else {
    if (iVar2 == 0) {
      *(int *)(this + 0x4a4) = param_1;
      if (param_1 == 1) goto LAB_006f763a;
LAB_006f746b:
      if (param_1 == -1) {
        iVar2 = *(int *)(this + 0x490);
        if (*(float *)(this + 0x4a0) <= 0.0) {
          iVar1 = *(int *)(iVar2 + 0x474);
          *(int *)(this + 0x494) = iVar1;
          if (iVar1 == 0) goto LAB_006f7608;
        }
        else {
          *(int *)(this + 0x494) = iVar2;
          iVar3 = *(int *)(iVar2 + 0x470);
          *(int *)(this + 0x490) = iVar3;
          iVar1 = iVar2;
          iVar2 = iVar3;
        }
        iVar3 = *(int *)(iVar1 + 0x474);
        goto LAB_006f7656;
      }
      iVar1 = *(int *)(this + 0x494);
      if (iVar1 == 0) goto LAB_006f7608;
      iVar2 = *(int *)(this + 0x490);
      *(int *)(this + 0x49c) = iVar1;
      iVar3 = iVar2;
    }
    else {
      (**(code **)(*(int *)this + 0x328))(this);
      *(int *)(this + 0x4a4) = param_1;
      if (param_1 != 1) goto LAB_006f746b;
LAB_006f763a:
      iVar2 = *(int *)(this + 0x490);
      iVar1 = *(int *)(iVar2 + 0x470);
      *(int *)(this + 0x494) = iVar1;
      if (iVar1 == 0) {
LAB_006f7608:
        (**(code **)(*(int *)this + 0x328))(this);
        return 0;
      }
      iVar3 = *(int *)(iVar1 + 0x470);
LAB_006f7656:
      if (iVar3 != 0) {
        iVar1 = iVar3;
      }
      *(int *)(this + 0x49c) = iVar1;
      if (param_1 == 1) {
        iVar3 = *(int *)(iVar2 + 0x474);
        iVar1 = *(int *)(this + 0x494);
      }
      else if (param_1 == -1) {
        iVar3 = *(int *)(iVar2 + 0x470);
        iVar1 = *(int *)(this + 0x494);
      }
      else {
        iVar1 = *(int *)(this + 0x494);
        iVar3 = iVar2;
      }
    }
    *(int *)(this + 0x498) = iVar3;
    if (iVar3 == 0) {
      *(int *)(this + 0x498) = iVar2;
    }
  }
  if (iVar1 == 0) {
    return 0;
  }
  fVar8 = *(float *)(this + 0x2d0);
LAB_006f74ae:
  fVar5 = *(float *)(this + 0x4a0);
  if (*(int *)(this + 0x4a4) == 1) {
    iVar2 = *(int *)(this + 0x490);
    fVar9 = fVar8 - fVar5;
    *(float *)(this + 0x484) = fVar9;
    fVar5 = (*(float *)(iVar2 + 0x46c) - fVar5) + fVar8;
    *(float *)(this + 0x488) = fVar5;
  }
  else {
    if (fVar5 != 0.0) {
      fVar5 = *(float *)(iVar1 + 0x46c) - fVar5;
      *(float *)(this + 0x4a0) = fVar5;
    }
    iVar2 = *(int *)(this + 0x490);
    fVar9 = fVar8 - fVar5;
    *(float *)(this + 0x484) = fVar9;
    fVar5 = (*(float *)(iVar1 + 0x46c) + fVar8) - fVar5;
    *(float *)(this + 0x488) = fVar5;
  }
  fVar7 = *(float *)(iVar2 + 0x440) - *(float *)(iVar1 + 0x440);
  fVar4 = *(float *)(iVar2 + 0x448) - *(float *)(iVar1 + 0x448);
  fVar6 = *(float *)(iVar2 + 0x444) - *(float *)(iVar1 + 0x444);
  *(float *)(this + 0x48c) = (fVar5 - fVar9) / SQRT(fVar4 * fVar4 + fVar7 * fVar7 + fVar6 * fVar6);
  CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,fVar5 - fVar8);
  return 1;
}

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)