L L4D2node

CTerrorPlayer::OnUseEntityChanged

0x009997d0 · 424 bytes · __thiscall

_ZN13CTerrorPlayer18OnUseEntityChangedEv

Decompiled

undefined (1 param)

/* CTerrorPlayer::OnUseEntityChanged() */

void __thiscall CTerrorPlayer::OnUseEntityChanged(CTerrorPlayer *this)

{
  CBaseEdict *pCVar1;
  undefined *puVar2;
  int iVar3;
  undefined *puVar4;
  uint uVar5;
  CTerrorPlayer CVar6;
  longdouble lVar7;
  
  lVar7 = (longdouble)IntervalTimer::Now();
  if ((float)lVar7 != *(float *)(this + 0x33b8)) {
    (**(code **)(*(int *)(this + 0x33b4) + 4))(this + 0x33b4,this + 0x33b8);
    *(float *)(this + 0x33b8) = (float)lVar7;
  }
  puVar4 = g_pEntityList;
  uVar5 = *(uint *)(this + 0x1d14);
  CVar6 = (CTerrorPlayer)0x0;
  if (uVar5 != 0xffffffff) {
    puVar2 = g_pEntityList + (uVar5 & 0xfff) * 0x10;
    if (((puVar2 != (undefined *)0xfffffffc) && (*(uint *)(puVar2 + 8) == uVar5 >> 0xc)) &&
       (*(int *)(puVar2 + 4) != 0)) {
      iVar3 = __dynamic_cast(*(int *)(puVar2 + 4),&CBaseEntity::typeinfo,&CPropMountedGun::typeinfo,
                             0);
      CVar6 = (CTerrorPlayer)(iVar3 != 0);
    }
  }
  if (CVar6 != this[0x33bc]) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
        uVar5 = *(uint *)(this + 0x1d14);
        puVar4 = g_pEntityList;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    this[0x33bc] = CVar6;
  }
  CVar6 = (CTerrorPlayer)0x0;
  if (((uVar5 != 0xffffffff) &&
      (puVar4 = puVar4 + (uVar5 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
     ((*(uint *)(puVar4 + 8) == uVar5 >> 0xc && (*(int *)(puVar4 + 4) != 0)))) {
    iVar3 = __dynamic_cast(*(int *)(puVar4 + 4),&CBaseEntity::typeinfo,&CBaseMountedWeapon::typeinfo
                           ,0);
    CVar6 = (CTerrorPlayer)(iVar3 != 0);
  }
  if (CVar6 != this[0x33bd]) {
    if (this[0x6c] == (CTerrorPlayer)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar3 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CTerrorPlayer)((byte)this[0x70] | 1);
    }
    this[0x33bd] = CVar6;
  }
  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)