L L4D2node

CFuncElevator::MoveTo

0x006be000 · 1434 bytes · __thiscall

_ZN13CFuncElevator6MoveToEf

Decompiled

undefined (2 params)

/* CFuncElevator::MoveTo(float) */

void __thiscall CFuncElevator::MoveTo(CFuncElevator *this,float param_1)

{
  CFuncElevator CVar1;
  CBaseEdict *pCVar2;
  code *pcVar3;
  int iVar4;
  char cVar5;
  int iVar6;
  int *piVar7;
  char *pcVar8;
  int *piVar9;
  float fVar10;
  undefined1 local_264 [16];
  undefined1 local_254 [8];
  float local_24c;
  undefined1 local_248 [8];
  float local_240;
  undefined **local_23c [4];
  int local_22c;
  int local_21c;
  undefined1 *local_218;
  undefined4 local_214;
  undefined4 local_210;
  undefined4 local_20c;
  undefined4 local_208;
  undefined4 local_204;
  undefined4 local_200;
  undefined4 local_1fc;
  undefined1 local_1f8;
  undefined1 local_1f7;
  undefined1 local_1f6;
  undefined4 local_1f4;
  undefined4 local_1f0;
  undefined4 local_1ec;
  undefined4 local_1e8;
  undefined4 local_1e4;
  undefined4 local_1e0;
  undefined2 local_1dc;
  
  if (this[0x508] != (CFuncElevator)0x0) {
    if (this[0x4fc] != (CFuncElevator)0x1) {
      if (this[0x6c] == (CFuncElevator)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFuncElevator)((byte)this[0x70] | 1);
      }
      this[0x4fc] = (CFuncElevator)0x1;
    }
    fVar10 = *(float *)(elevator_movedelay._28_4_ + 0x2c) + *(float *)(gpGlobals + 0xc);
    if (fVar10 != *(float *)(this + 0x4ec)) {
      if (this[0x6c] == (CFuncElevator)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFuncElevator)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4ec) = fVar10;
    }
    fVar10 = *(float *)(this + 0x500);
    *(undefined4 *)(this + 0x50c) = 0xbf800000;
    if (fVar10 == *(float *)(this + 0x4f0)) {
      CVar1 = this[0x14d];
    }
    else {
      if (this[0x6c] == (CFuncElevator)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFuncElevator)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4f0) = fVar10;
      CVar1 = this[0x14d];
    }
    if (((byte)CVar1 & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    fVar10 = *(float *)(this + 0x2e8);
    if (fVar10 != *(float *)(this + 0x4f4)) {
      if (this[0x6c] == (CFuncElevator)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFuncElevator)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4f4) = fVar10;
    }
    if (param_1 == *(float *)(this + 0x4f8)) {
      iVar6 = *(int *)(this + 0x4b8);
    }
    else {
      if (this[0x6c] == (CFuncElevator)0x0) {
        pCVar2 = *(CBaseEdict **)(this + 0x30);
        if (pCVar2 != (CBaseEdict *)0x0) {
          *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
          iVar6 = CBaseEdict::GetChangeAccessor(pCVar2);
          *(undefined2 *)(iVar6 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CFuncElevator)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4f8) = param_1;
      iVar6 = *(int *)(this + 0x4b8);
    }
    piVar9 = (int *)&stack0xfffffd74;
    if (iVar6 != 0) {
      if (iVar6 == *(int *)(this + 0x4c4)) {
        pcVar8 = "";
        if (*(char **)(this + 0x4bc) != (char *)0x0) {
          pcVar8 = *(char **)(this + 0x4bc);
        }
        if (*(int *)(this + 0x30) == 0) {
          iVar6 = 0;
        }
        else {
          iVar6 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
        CBaseEntity::StopSound(iVar6,4,pcVar8);
        piVar9 = (int *)&stack0xfffffd74;
      }
      else {
        *(int *)(this + 0x4c4) = iVar6;
        (**(code **)(*(int *)this + 0x28c))();
        CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_23c);
        local_23c[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 006be13a to 006be13e has its CatchHandler @ 006be5f0 */
        CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_23c,(Vector *)&local_21c);
        local_23c[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 006be158 to 006be174 has its CatchHandler @ 006be602 */
        (**(code **)(*(int *)this + 0x28c))();
        CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_23c,(Vector *)&local_21c,0.8);
        local_1f8 = 1;
        local_1dc = 0xffff;
        local_214 = 0x3f800000;
        local_20c = 0;
        local_208 = 100;
        local_204 = 0;
        local_200 = 0;
        local_1fc = 0;
        local_1f7 = 0;
        local_218 = &DAT_00d539c2;
        if (*(undefined1 **)(this + 0x4b8) != (undefined1 *)0x0) {
          local_218 = *(undefined1 **)(this + 0x4b8);
        }
        local_1f6 = 0;
        local_1f4 = 0xffffffff;
        local_1f0 = 0;
        local_1ec = 0;
        local_1e8 = 0;
        local_1e4 = 0;
        local_1e0 = 0;
        local_21c = 4;
        local_210 = 0x4b;
        if (*(int *)(this + 0x30) == 0) {
          iVar6 = 0;
        }
        else {
          iVar6 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
                    /* try { // try from 006be260 to 006be264 has its CatchHandler @ 006be5a8 */
        CBaseEntity::EmitSound((IRecipientFilter *)local_23c,iVar6,(EmitSound_t *)&local_21c);
        local_1e4 = 0;
        CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_1f0);
        local_1e0 = local_1f0;
        CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_1f0);
        local_23c[0] = &PTR__CPASFilter_00bfaf28;
        CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_23c);
        piVar9 = (int *)&stack0xfffffd6c;
      }
    }
    iVar6 = *(int *)this;
    *piVar9 = (int)this;
    pcVar3 = *(code **)(iVar6 + 0x10);
    piVar9[-1] = 0x6be2bd;
    piVar7 = (int *)(*pcVar3)();
    iVar6 = *piVar7;
    piVar9[2] = (int)local_248;
    piVar9[1] = (int)local_254;
    *piVar9 = (int)piVar7;
    pcVar3 = *(code **)(iVar6 + 0x3c);
    piVar9[-1] = 0x6be2df;
    (*pcVar3)();
    piVar9[1] = (int)&local_21c;
    piVar9[3] = 0;
    piVar9[2] = 0x80;
    local_240 = local_240 + 71.0;
    *piVar9 = (int)local_23c;
    local_24c = local_24c - 71.0;
    piVar9[-1] = 0x6be32b;
    CFlaggedEntitiesEnum::CFlaggedEntitiesEnum
              ((CFlaggedEntitiesEnum *)*piVar9,(CBaseEntity **)piVar9[1],piVar9[2],piVar9[3]);
    piVar9[2] = (int)local_23c;
    *piVar9 = (int)local_254;
    piVar9[1] = (int)local_248;
    piVar9[-1] = 0x6be347;
    UTIL_EntitiesInBox((Vector *)*piVar9,(Vector *)piVar9[1],(CFlaggedEntitiesEnum *)piVar9[2]);
    if (0 < local_22c) {
      iVar6 = 0;
LAB_006be37f:
      do {
        iVar4 = (&local_21c)[iVar6];
        if (*(char **)(iVar4 + 0x7c) != "prop_physics") {
          piVar9[1] = (int)"prop_physics";
          *piVar9 = iVar4;
          piVar9[-1] = 0x6be370;
          cVar5 = CBaseEntity::ClassMatchesComplex((CBaseEntity *)*piVar9,(char *)piVar9[1]);
          if (cVar5 == '\0') {
            iVar6 = iVar6 + 1;
            if (local_22c <= iVar6) break;
            goto LAB_006be37f;
          }
        }
        *piVar9 = iVar4;
        iVar6 = iVar6 + 1;
        piVar9[-1] = 0x6be396;
        UTIL_Remove((CBaseEntity *)*piVar9);
      } while (iVar6 < local_22c);
    }
    piVar9[5] = 0;
    piVar9[4] = 0;
    piVar9[2] = 0;
    piVar9[3] = 0;
    piVar9[1] = (int)this;
    *piVar9 = (int)local_264;
    piVar9[-1] = 0x6be3d3;
    CBaseEntity::ThinkSet((_func_void *)*piVar9,(float)piVar9[1],(char *)piVar9[2]);
  }
  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)