L L4D2node

CPhysMotor::Activate

0x007a4b30 · 1048 bytes · __thiscall

_ZN10CPhysMotor8ActivateEv

Decompiled

undefined (1 param)

/* CPhysMotor::Activate() */

void __thiscall CPhysMotor::Activate(CPhysMotor *this)

{
  code *pcVar1;
  undefined4 uVar2;
  char *pcVar3;
  uint *puVar4;
  int *piVar5;
  uint uVar6;
  int *piVar7;
  undefined *puVar8;
  int iVar9;
  uint uVar10;
  undefined4 *puVar11;
  int iVar12;
  undefined4 uStackY_a0;
  float local_74;
  float local_70;
  float local_6c;
  float local_68;
  float local_64;
  float local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined1 local_20;
  
  puVar11 = (undefined4 *)&stack0xffffff64;
  uStackY_a0 = 0x7a4b47;
  CBaseEntity::Activate((CBaseEntity *)this);
  uVar6 = *(uint *)(this + 0x444);
  if (uVar6 != 0xffffffff) {
    uVar10 = uVar6 & 0xfff;
    piVar7 = (int *)(g_pEntityList + uVar10 * 0x10 + 4);
    if (((piVar7 != (int *)0x0) && (*(uint *)(g_pEntityList + uVar10 * 0x10 + 8) == uVar6 >> 0xc))
       && (*(int *)(g_pEntityList + uVar10 * 0x10 + 4) != 0)) goto LAB_007a4c15;
  }
  pcVar3 = "";
  if (*(char **)(this + 0x440) != (char *)0x0) {
    pcVar3 = *(char **)(this + 0x440);
  }
  uStackY_a0 = 0x7a4bc0;
  piVar7 = (int *)CGlobalEntityList::FindEntityByName
                            ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,pcVar3,
                             (CBaseEntity *)0x0,(CBaseEntity *)0x0,(CBaseEntity *)0x0,
                             (IEntityFindFilter *)0x0);
  puVar11 = (undefined4 *)&stack0xffffff64;
  if ((piVar7 != (int *)0x0) &&
     (puVar11 = (undefined4 *)&stack0xffffff64, *(char *)((int)piVar7 + 0x186) == '\x06')) {
    uStackY_a0 = 0x7a4d18;
    puVar4 = (uint *)(**(code **)(*piVar7 + 0xc))();
    puVar8 = g_pEntityList;
    iVar9 = 0;
    uVar6 = *puVar4;
    *(uint *)(this + 0x444) = uVar6;
    if ((uVar6 != 0xffffffff) &&
       ((puVar8 = puVar8 + (uVar6 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc &&
        (*(uint *)(puVar8 + 8) == uVar6 >> 0xc)))) {
      iVar9 = *(int *)(puVar8 + 4);
    }
    piVar7 = *(int **)(iVar9 + 0x238);
    if (*(float *)(this + 0x448) == 0.0) {
      *(float *)(this + 0x450) = ABS(*(float *)(this + 0x11c));
    }
    else {
      *(float *)(this + 0x450) = ABS(*(float *)(this + 0x11c) / *(float *)(this + 0x448));
    }
    uStackY_a0 = 0x7a4d98;
    (**(code **)(*piVar7 + 200))();
    uStackY_a0 = 0x7a4db1;
    VectorIRotate((float *)(this + 0x46c),(matrix3x4_t *)&local_5c,&local_74);
    uStackY_a0 = 0x7a4dc3;
    (**(code **)(*piVar7 + 0x80))();
    *(undefined4 *)(this + 0x488) = 0x3f800000;
    puVar11 = &uStackY_a0;
    *(float *)(this + 0x468) =
         (*(float *)(this + 0x44c) + *(float *)(this + 0x450)) * *(float *)(this + 0x478) *
         (ABS(local_70 * local_64) + ABS(local_74 * local_68) + ABS(local_6c * local_60));
  }
  uVar6 = *(uint *)(this + 0x444);
  if (uVar6 == 0xffffffff) {
    return;
  }
  piVar7 = (int *)(g_pEntityList + (uVar6 & 0xfff) * 0x10 + 4);
  if (piVar7 == (int *)0x0) {
    return;
  }
  if (piVar7[1] != uVar6 >> 0xc) {
    return;
  }
LAB_007a4c15:
  if (*piVar7 != 0) {
    piVar7 = *(int **)(*piVar7 + 0x238);
    uVar6 = *(uint *)(this + 0x148);
    if ((uVar6 & 4) == 0) {
      *(undefined4 *)(this + 0x458) = 0;
    }
    else {
      if (*(int *)(this + 0x458) == 0) {
        local_44 = 0;
        local_50 = *(undefined4 *)(this + 0x46c);
        local_40 = 0;
        local_3c = 0;
        local_4c = *(undefined4 *)(this + 0x470);
        local_38 = 0;
        local_48 = *(undefined4 *)(this + 0x474);
        local_30 = 0;
        local_5c = *(undefined4 *)(this + 0x39c);
        local_2c = 0;
        local_58 = *(undefined4 *)(this + 0x3a0);
        local_34 = 0x3f800000;
        local_54 = *(undefined4 *)(this + 0x3a4);
        local_28 = 0x3f800000;
        local_24 = 0x3f800000;
        local_20 = 1;
        iVar9 = *physenv;
        puVar11[4] = &local_5c;
        puVar11[3] = 0;
        puVar11[2] = piVar7;
        *puVar11 = physenv;
        puVar11[1] = g_PhysWorldObject;
        pcVar1 = *(code **)(iVar9 + 0x44);
        puVar11[-1] = 0x7a4f3b;
        piVar5 = (int *)(*pcVar1)();
        *(int **)(this + 0x458) = piVar5;
        iVar9 = *piVar5;
        *puVar11 = piVar5;
        puVar11[1] = this;
        pcVar1 = *(code **)(iVar9 + 0x10);
        puVar11[-1] = 0x7a4f4d;
        (*pcVar1)();
        iVar9 = *piVar7;
        *puVar11 = piVar7;
        pcVar1 = *(code **)(iVar9 + 0x50);
        puVar11[-1] = 0x7a4f55;
        uVar6 = (*pcVar1)();
        iVar9 = *piVar7;
        *puVar11 = piVar7;
        puVar11[1] = uVar6 & 0xffff | 0x80;
        pcVar1 = *(code **)(iVar9 + 0x4c);
        puVar11[-1] = 0x7a4f66;
        (*pcVar1)();
        uVar6 = *(uint *)(this + 0x148);
      }
      if ((uVar6 & 2) != 0) {
        puVar11[1] = piVar7;
        *puVar11 = g_PhysWorldObject;
        puVar11[-1] = 0x7a4d01;
        PhysDisableEntityCollisions((IPhysicsObject *)*puVar11,(IPhysicsObject *)puVar11[1]);
      }
    }
    if (*(int *)(this + 0x45c) == 0) {
      iVar12 = 0;
      iVar9 = *physenv;
      puVar11[1] = this + 0x460;
      *puVar11 = physenv;
      pcVar1 = *(code **)(iVar9 + 0x78);
      puVar11[-1] = 0x7a4c68;
      piVar7 = (int *)(*pcVar1)();
      *(int **)(this + 0x45c) = piVar7;
      pcVar1 = *(code **)(*piVar7 + 0xc);
      uVar6 = *(uint *)(this + 0x444);
      if (((uVar6 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar6 >> 0xc)) {
        iVar12 = *(int *)(puVar8 + 4);
      }
      puVar11[2] = 0;
      uVar2 = *(undefined4 *)(iVar12 + 0x238);
      *puVar11 = piVar7;
      puVar11[1] = uVar2;
      puVar11[-1] = 0x7a4cc1;
      (*pcVar1)();
      if (((byte)this[0x148] & 1) != 0) {
        *puVar11 = this;
        puVar11[-1] = 0x7a4cd6;
        TurnOn((CPhysMotor *)*puVar11);
      }
    }
  }
  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)