L L4D2node

CFuncTrain::Wait

0x00b11ad0 · 1097 bytes · __thiscall

_ZN10CFuncTrain4WaitEv

Decompiled

undefined (1 param)

/* CFuncTrain::Wait() */

void __thiscall CFuncTrain::Wait(CFuncTrain *this)

{
  uint uVar1;
  CBaseEdict *this_00;
  undefined *puVar2;
  int iVar3;
  int *piVar4;
  undefined4 *puVar5;
  int local_90;
  undefined **local_80 [8];
  undefined4 local_60;
  undefined1 *local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined1 local_3c;
  undefined1 local_3b;
  undefined1 local_3a;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined2 local_20;
  
  piVar4 = (int *)0x0;
  puVar5 = (undefined4 *)&stack0xffffff54;
  uVar1 = *(uint *)(this + 0x4d0);
  if (((uVar1 != 0xffffffff) &&
      (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar2 + 8) == uVar1 >> 0xc)) {
    piVar4 = *(int **)(puVar2 + 4);
  }
  local_60 = 0;
  local_54 = 0xffffffff;
  local_50 = 0;
  (**(code **)(*piVar4 + 0xb4))();
  uVar1 = *(uint *)(this + 0x4d0);
  iVar3 = 0;
  if (((uVar1 != 0xffffffff) &&
      (puVar2 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar2 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar2 + 8) == uVar1 >> 0xc)) {
    iVar3 = *(int *)(puVar2 + 4);
  }
  uVar1 = *(uint *)(this + 0x148);
  if (((*(byte *)(iVar3 + 0x148) & 1) == 0) && ((uVar1 & 1) == 0)) {
    if (*(float *)(this + 0x448) != 0.0) {
      CBaseEntity::SetMoveDoneTime((CBaseEntity *)this,*(float *)(this + 0x448));
      CBasePlatTrain::StopMovingSound((CBasePlatTrain *)this);
      if (*(int *)(this + 0x4bc) != 0) {
        (**(code **)(*(int *)this + 0x28c))();
        CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
        local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00b11db4 to 00b11db8 has its CatchHandler @ 00b11f37 */
        CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
        local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00b11dc9 to 00b11de5 has its CatchHandler @ 00b11f75 */
        (**(code **)(*(int *)this + 0x28c))();
        CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
        local_3c = 1;
        local_20 = 0xffff;
        local_58 = *(undefined4 *)(this + 0x4c4);
        local_50 = 0;
        local_4c = 100;
        local_48 = 0;
        local_5c = &DAT_00d539c2;
        if (*(undefined1 **)(this + 0x4bc) != (undefined1 *)0x0) {
          local_5c = *(undefined1 **)(this + 0x4bc);
        }
        local_44 = 0;
        local_40 = 0;
        local_3b = 0;
        local_3a = 0;
        local_38 = 0xffffffff;
        local_34 = 0;
        local_30 = 0;
        local_2c = 0;
        local_28 = 0;
        local_24 = 0;
        local_60 = 2;
        local_54 = 0x4b;
        local_90 = 0;
        if (*(int *)(this + 0x30) != 0) {
          local_90 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
        }
                    /* try { // try from 00b11ea4 to 00b11ea8 has its CatchHandler @ 00b11f73 */
        CBaseEntity::EmitSound((IRecipientFilter *)local_80,local_90,(EmitSound_t *)&local_60);
        local_28 = 0;
        CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
        local_24 = local_34;
        CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
        local_80[0] = &PTR__CPASFilter_00bfaf28;
        CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
      }
      *(code **)(this + 0x14) = Next;
      *(undefined4 *)(this + 0x18) = 0;
      return;
    }
    Next(this);
    return;
  }
  if ((uVar1 | 1) != uVar1) {
    if (this[0x6c] == (CFuncTrain)0x0) {
      this_00 = *(CBaseEdict **)(this + 0x30);
      if (this_00 != (CBaseEdict *)0x0) {
        *(uint *)this_00 = *(uint *)this_00 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(this_00);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CFuncTrain)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0x148) = uVar1 | 1;
  }
  CBasePlatTrain::StopMovingSound((CBasePlatTrain *)this);
  if (*(int *)(this + 0x4bc) != 0) {
    (**(code **)(*(int *)this + 0x28c))();
    CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_80);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
                    /* try { // try from 00b11c1b to 00b11c1f has its CatchHandler @ 00b11f49 */
    CRecipientFilter::AddRecipientsByPAS((CRecipientFilter *)local_80,(Vector *)&local_60);
    local_80[0] = &PTR__CPASAttenuationFilter_00c08ec8;
                    /* try { // try from 00b11c30 to 00b11c4c has its CatchHandler @ 00b11f4b */
    (**(code **)(*(int *)this + 0x28c))();
    puVar5 = (undefined4 *)&stack0xffffff4c;
    CPASAttenuationFilter::Filter((CPASAttenuationFilter *)local_80,(Vector *)&local_60,0.8);
    local_58 = *(undefined4 *)(this + 0x4c4);
    local_50 = 0;
    local_4c = 100;
    local_48 = 0;
    local_44 = 0;
    local_5c = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x4bc) != (undefined1 *)0x0) {
      local_5c = *(undefined1 **)(this + 0x4bc);
    }
    local_40 = 0;
    local_3c = 1;
    local_3b = 0;
    local_3a = 0;
    local_38 = 0xffffffff;
    local_34 = 0;
    local_30 = 0;
    local_2c = 0;
    local_28 = 0;
    local_24 = 0;
    local_20 = 0xffff;
    local_60 = 2;
    local_54 = 0x4b;
    if (*(int *)(this + 0x30) == 0) {
      iVar3 = 0;
    }
    else {
      iVar3 = *(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
                    /* try { // try from 00b11cff to 00b11d03 has its CatchHandler @ 00b11f64 */
    CBaseEntity::EmitSound((IRecipientFilter *)local_80,iVar3,(EmitSound_t *)&local_60);
    local_28 = 0;
    CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
    local_24 = local_34;
    CUtlMemory<Vector,int>::Purge((CUtlMemory<Vector,int> *)&local_34);
    local_80[0] = &PTR__CPASFilter_00bfaf28;
    CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_80);
  }
  *puVar5 = this;
  puVar5[1] = 0xbf800000;
  puVar5[-1] = 0xb11d43;
  CBaseEntity::SetMoveDoneTime((CBaseEntity *)*puVar5,(float)puVar5[1]);
  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)