L L4D2node

CTerrorPlayer::UpdateFXVolume

0x009faac0 · 1304 bytes · __thiscall

_ZN13CTerrorPlayer14UpdateFXVolumeEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::UpdateFXVolume() */

void __thiscall CTerrorPlayer::UpdateFXVolume(CTerrorPlayer *this)

{
  uint uVar1;
  code *pcVar2;
  uint *puVar3;
  CBaseEntity *this_00;
  int iVar4;
  undefined4 *puVar5;
  int iVar6;
  undefined *puVar7;
  int *piVar8;
  char *pcVar9;
  int *piVar10;
  undefined4 local_60;
  undefined *local_48;
  int *local_44;
  int *local_40;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  piVar8 = (int *)&stack0xffffffa4;
  uVar1 = *(uint *)(this + 0x2088);
  if ((((uVar1 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar1 >> 0xc)) ||
     (this_00 = *(CBaseEntity **)(puVar7 + 4), this_00 == (CBaseEntity *)0x0)) {
    local_60 = 0x9fab0f;
    (**(code **)(*(int *)this + 0x234))();
    piVar8 = &local_60;
    local_34 = local_28;
    local_30 = local_24;
    local_2c = local_20;
  }
  else {
    if (((byte)this_00[0x14d] & 8) != 0) {
      local_60 = 0x9fadd8;
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    local_34 = *(undefined4 *)(this_00 + 0x2e0);
    local_30 = *(undefined4 *)(this_00 + 0x2e4);
    local_2c = *(undefined4 *)(this_00 + 0x2e8);
  }
  *piVar8 = (int)&local_34;
  piVar8[-1] = 0x9fab3b;
  iVar4 = CFogVolume::FindFogVolumeForPosition((Vector *)*piVar8);
  if (iVar4 == 0) {
    if (DAT_01003e88 < 1) {
      return;
    }
    piVar8[-1] = 0x9fae12;
    iVar6 = FogSystem();
    local_44 = (int *)0x0;
    uVar1 = *(uint *)(iVar6 + 0x18);
    if ((uVar1 != 0xffffffff) &&
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) {
      if (*(uint *)(puVar7 + 8) == uVar1 >> 0xc) {
        local_44 = *(int **)(puVar7 + 4);
      }
      else {
        local_44 = (int *)0x0;
      }
    }
    piVar8[-1] = 0x9fae4f;
    iVar6 = PostProcessSystem();
    local_40 = (int *)0x0;
    uVar1 = *(uint *)(iVar6 + 0x18);
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      local_40 = *(int **)(puVar7 + 4);
    }
    piVar8[-1] = 0x9fae95;
    iVar6 = ColorCorrectionSystem();
    uVar1 = *(uint *)(iVar6 + 0x18);
    piVar10 = (int *)0x0;
    local_48 = g_pEntityList;
  }
  else {
    local_44 = (int *)0x0;
    local_48 = g_pEntityList;
    uVar1 = *(uint *)(iVar4 + 0x44c);
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      local_44 = *(int **)(puVar7 + 4);
    }
    uVar1 = *(uint *)(iVar4 + 0x450);
    local_40 = (int *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      local_40 = *(int **)(puVar7 + 4);
    }
    uVar1 = *(uint *)(iVar4 + 0x454);
    piVar10 = (int *)0x0;
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
      piVar10 = *(int **)(puVar7 + 4);
    }
    if (local_44 == (int *)0x0) {
      piVar8[-1] = 0x9fafd5;
      iVar6 = FogSystem();
      local_48 = g_pEntityList;
      uVar1 = *(uint *)(iVar6 + 0x18);
      if (((uVar1 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
        local_44 = *(int **)(puVar7 + 4);
      }
    }
    if (local_40 == (int *)0x0) {
      piVar8[-1] = 0x9faf85;
      g_pEntityList = local_48;
      iVar6 = PostProcessSystem();
      local_48 = g_pEntityList;
      uVar1 = *(uint *)(iVar6 + 0x18);
      if (((uVar1 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
        local_40 = *(int **)(puVar7 + 4);
      }
    }
    if (piVar10 != (int *)0x0) goto LAB_009fac00;
    piVar8[-1] = 0x9faf65;
    g_pEntityList = local_48;
    iVar6 = ColorCorrectionSystem();
    uVar1 = *(uint *)(iVar6 + 0x18);
    local_48 = g_pEntityList;
  }
  if (((uVar1 != 0xffffffff) &&
      (puVar7 = local_48 + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
    piVar10 = *(int **)(puVar7 + 4);
  }
LAB_009fac00:
  g_pEntityList = local_48;
  if ((local_44 != (int *)0x0) &&
     ((((uVar1 = *(uint *)(this + 0x1c14), uVar1 == 0xffffffff ||
        (local_48 = local_48 + (uVar1 & 0xfff) * 0x10, local_48 == (undefined *)0xfffffffc)) ||
       (*(uint *)(local_48 + 8) != uVar1 >> 0xc)) || (local_44 != *(int **)(local_48 + 4))))) {
    iVar6 = *(int *)(this + 0x1c10);
    *piVar8 = (int)(this + 0x1c10);
    piVar8[1] = (int)(this + 0x1c14);
    pcVar2 = *(code **)(iVar6 + 4);
    piVar8[-1] = 0x9fac53;
    (*pcVar2)();
    iVar6 = *local_44;
    *piVar8 = (int)local_44;
    pcVar2 = *(code **)(iVar6 + 0xc);
    piVar8[-1] = 0x9fac5e;
    puVar5 = (undefined4 *)(*pcVar2)();
    *(undefined4 *)(this + 0x1c14) = *puVar5;
    if (*(int *)(ZombieDebugFog._28_4_ + 0x30) != 0) {
      if (iVar4 == 0) {
        pcVar9 = "master volume";
      }
      else {
        pcVar9 = "";
        if (*(char **)(iVar4 + 0x440) != (char *)0x0) {
          pcVar9 = *(char **)(iVar4 + 0x440);
        }
      }
      iVar4 = *(int *)this;
      *piVar8 = (int)this;
      pcVar2 = *(code **)(iVar4 + 0xb8);
      piVar8[-1] = 0x9fac95;
      iVar4 = (*pcVar2)();
      piVar8[2] = (int)pcVar9;
      piVar8[1] = iVar4;
      *piVar8 = (int)"%s entering fog %s\n";
      piVar8[-1] = 0x9faca9;
      DevMsg((char *)*piVar8);
    }
  }
  if ((local_40 != (int *)0x0) &&
     (((uVar1 = *(uint *)(this + 0x1c60), uVar1 == 0xffffffff ||
       (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      ((*(uint *)(puVar7 + 8) != uVar1 >> 0xc || (*(int **)(puVar7 + 4) != local_40)))))) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      puVar3 = *(uint **)(this + 0x30);
      if (puVar3 != (uint *)0x0) {
        *puVar3 = *puVar3 | 0x101;
        *piVar8 = (int)puVar3;
        piVar8[-1] = 0x9fad00;
        iVar4 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar8);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    iVar4 = *local_40;
    *piVar8 = (int)local_40;
    pcVar2 = *(code **)(iVar4 + 0xc);
    piVar8[-1] = 0x9fad11;
    puVar5 = (undefined4 *)(*pcVar2)();
    *(undefined4 *)(this + 0x1c60) = *puVar5;
  }
  if (piVar10 != (int *)0x0) {
    uVar1 = *(uint *)(this + 0x1c64);
    if (((uVar1 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar7 + 8) == uVar1 >> 0xc && (*(int **)(puVar7 + 4) == piVar10)))) {
      return;
    }
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      puVar3 = *(uint **)(this + 0x30);
      if (puVar3 != (uint *)0x0) {
        *puVar3 = *puVar3 | 0x101;
        *piVar8 = (int)puVar3;
        piVar8[-1] = 0x9fad6d;
        iVar4 = CBaseEdict::GetChangeAccessor((CBaseEdict *)*piVar8);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    iVar4 = *piVar10;
    *piVar8 = (int)piVar10;
    pcVar2 = *(code **)(iVar4 + 0xc);
    piVar8[-1] = 0x9fad7b;
    puVar5 = (undefined4 *)(*pcVar2)();
    *(undefined4 *)(this + 0x1c64) = *puVar5;
  }
  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)