L L4D2node

CBasePlayer::OnTonemapTriggerStartTouch

0x007b9e30 · 365 bytes · __thiscall

_ZN11CBasePlayer26OnTonemapTriggerStartTouchEP15CTonemapTrigger

Decompiled

undefined (2 params)

/* CBasePlayer::OnTonemapTriggerStartTouch(CTonemapTrigger*) */

void __thiscall CBasePlayer::OnTonemapTriggerStartTouch(CBasePlayer *this,CTonemapTrigger *param_1)

{
  int iVar1;
  undefined4 *puVar2;
  int iVar3;
  void *pvVar4;
  int iVar5;
  int iVar6;
  undefined4 local_30;
  undefined4 local_20 [4];
  
  local_20[0] = 0xffffffff;
  if (param_1 == (CTonemapTrigger *)0x0) {
    CUtlVector<CHandle<CTonemapTrigger>,CUtlMemory<CHandle<CTonemapTrigger>,int>>::FindAndRemove
              ((CUtlVector<CHandle<CTonemapTrigger>,CUtlMemory<CHandle<CTonemapTrigger>,int>> *)
               (this + 0x1c4c),(CHandle *)local_20);
    local_30 = 0xffffffff;
  }
  else {
    puVar2 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_20[0] = *puVar2;
    CUtlVector<CHandle<CTonemapTrigger>,CUtlMemory<CHandle<CTonemapTrigger>,int>>::FindAndRemove
              ((CUtlVector<CHandle<CTonemapTrigger>,CUtlMemory<CHandle<CTonemapTrigger>,int>> *)
               (this + 0x1c4c),(CHandle *)local_20);
    puVar2 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_30 = *puVar2;
  }
  iVar1 = *(int *)(this + 0x1c58);
  iVar6 = *(int *)(this + 0x1c50);
  iVar5 = iVar1 + 1;
  if (iVar6 < iVar5) {
    iVar3 = *(int *)(this + 0x1c54);
    if (-1 < iVar3) {
      if (iVar3 == 0) {
        if (iVar6 == 0) {
          if (iVar5 < 9) {
            iVar3 = 8;
            goto LAB_007b9f0f;
          }
          iVar6 = 8;
        }
        do {
          iVar3 = iVar6 * 2;
          if (iVar5 <= iVar3) break;
          iVar3 = iVar6 * 4;
          iVar6 = iVar3;
        } while (iVar3 < iVar5);
      }
      else {
        for (iVar3 = (iVar1 / iVar3 + 1) * iVar3; iVar3 < iVar5; iVar3 = (iVar3 + iVar5) / 2) {
        }
      }
LAB_007b9f0f:
      *(int *)(this + 0x1c50) = iVar3;
      if (*(void **)(this + 0x1c4c) == (void *)0x0) {
        pvVar4 = malloc(iVar3 << 2);
        *(void **)(this + 0x1c4c) = pvVar4;
      }
      else {
        pvVar4 = realloc(*(void **)(this + 0x1c4c),iVar3 << 2);
        *(void **)(this + 0x1c4c) = pvVar4;
        iVar5 = *(int *)(this + 0x1c58) + 1;
      }
      goto LAB_007b9e96;
    }
  }
  pvVar4 = *(void **)(this + 0x1c4c);
LAB_007b9e96:
  *(int *)(this + 0x1c58) = iVar5;
  iVar6 = iVar1 * 4;
  iVar5 = (iVar5 - iVar1) + -1;
  *(void **)(this + 0x1c5c) = pvVar4;
  if (0 < iVar5) {
    _V_memmove((void *)((int)pvVar4 + iVar6 + 4),(void *)((int)pvVar4 + iVar6),iVar5 * 4);
    pvVar4 = *(void **)(this + 0x1c4c);
  }
  if ((undefined4 *)(iVar6 + (int)pvVar4) != (undefined4 *)0x0) {
    *(undefined4 *)(iVar6 + (int)pvVar4) = local_30;
  }
  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)