L L4D2node

MovePropAway

0x005057f0 · 717 bytes · __cdecl

_Z12MovePropAwayP11CBaseEntityP11CBasePlayer

Decompiled

undefined (2 params)

/* MovePropAway(CBaseEntity*, CBasePlayer*) */

undefined4 MovePropAway(CBaseEntity *param_1,CBasePlayer *param_2)

{
  char cVar1;
  uint uVar2;
  undefined4 uVar3;
  longdouble lVar4;
  undefined4 *local_74;
  Vector local_64 [12];
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  float local_4c;
  float local_48;
  float local_44;
  uint local_40;
  uint local_3c;
  uint local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  uint local_28;
  uint local_24;
  uint local_20;
  
  uVar2 = (**(code **)(*(int *)param_1 + 0x2c8))(param_1);
  if ((((byte)param_1[0x14d] & 8) == 0) ||
     (CBaseEntity::CalcAbsolutePosition(param_1), ((byte)param_1[0x14d] & 8) == 0)) {
    local_58 = *(undefined4 *)(param_1 + 0x37c);
    local_54 = *(undefined4 *)(param_1 + 0x380);
    local_50 = *(undefined4 *)(param_1 + 900);
  }
  else {
    CBaseEntity::CalcAbsolutePosition(param_1);
    local_58 = *(undefined4 *)(param_1 + 0x37c);
    local_54 = *(undefined4 *)(param_1 + 0x380);
    local_50 = *(undefined4 *)(param_1 + 900);
    if ((*(uint *)(param_1 + 0x14c) & 0x800) != 0) {
      CBaseEntity::CalcAbsolutePosition(param_1);
    }
  }
  if (((byte)param_2[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
  }
  local_4c = *(float *)(param_2 + 0x2e0) - *(float *)(param_1 + 0x2e0);
  local_48 = *(float *)(param_2 + 0x2e4) - *(float *)(param_1 + 0x2e4);
  local_44 = *(float *)(param_2 + 0x2e8) - *(float *)(param_1 + 0x2e8);
  cVar1 = FindEmptySpace(param_1,uVar2,(Vector *)&local_4c,local_64);
  if (cVar1 == '\0') {
    if ((((-0.01 < local_4c) && (local_4c < 0.01)) && (-0.01 < local_48)) &&
       (((local_48 < 0.01 && (-0.01 < local_44)) && (local_44 < 0.01)))) {
      lVar4 = (longdouble)RandomFloat(0xbf800000,0x3f800000);
      local_4c = (float)lVar4;
      lVar4 = (longdouble)RandomFloat(0xbf800000,0x3f800000);
      local_48 = (float)lVar4;
    }
    VectorNormalize((Vector *)&local_4c);
    VectorVectors((Vector *)&local_4c,(Vector *)&local_40,(Vector *)&local_34);
    cVar1 = FindEmptySpace(param_1,uVar2,(Vector *)&local_40,local_64);
    if (cVar1 == '\0') {
      local_20 = local_38 ^ 0x80000000;
      local_24 = local_3c ^ 0x80000000;
      local_28 = local_40 ^ 0x80000000;
      uVar3 = FindEmptySpace(param_1,uVar2,(Vector *)&local_28,local_64);
      if ((char)uVar3 == '\0') {
        return uVar3;
      }
    }
  }
  local_74 = &local_34;
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  CBaseEntity::SetAbsOrigin(param_1,local_64);
  (**(code **)(**(int **)(param_1 + 0x238) + 0xcc))(*(int **)(param_1 + 0x238),local_74,&local_28);
  (**(code **)(**(int **)(param_1 + 0x238) + 0xbc))(*(int **)(param_1 + 0x238),local_64,&local_58,1)
  ;
  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)