L L4D2node

CServerGameClients::ClientDisconnect

0x006c6890 · 352 bytes · __thiscall

_ZN18CServerGameClients16ClientDisconnectEP7edict_t

Decompiled

undefined (2 params)

/* CServerGameClients::ClientDisconnect(edict_t*) */

void __thiscall CServerGameClients::ClientDisconnect(CServerGameClients *this,edict_t *param_1)

{
  int *piVar1;
  uint *puVar2;
  edict_t *peVar3;
  CBaseEntity *this_00;
  int iVar4;
  CSound *this_01;
  CBaseEntity *in_stack_ffffffe8;
  
  peVar3 = param_1;
  if (((param_1 != (edict_t *)0x0) ||
      ((peVar3 = *(edict_t **)(gpGlobals + 0x58), peVar3 != (edict_t *)0x0 &&
       (((byte)*peVar3 & 2) == 0)))) && (piVar1 = *(int **)(peVar3 + 0xc), piVar1 != (int *)0x0)) {
    this_00 = (CBaseEntity *)(**(code **)(*piVar1 + 0x18))(piVar1);
    if (this_00 != (CBaseEntity *)0x0) {
      if (g_fGameOver == '\0') {
        if (*(float *)(this_00 + 0x1ff8) != 0.0) {
          if (this_00[0x6c] == (CBaseEntity)0x0) {
            puVar2 = *(uint **)(this_00 + 0x30);
            if (puVar2 != (uint *)0x0) {
              *puVar2 = *puVar2 | 0x101;
              iVar4 = (**(code **)(*engine + 0x184))(engine,puVar2);
              *(undefined2 *)(iVar4 + 2) = 0;
            }
          }
          else {
            this_00[0x70] = (CBaseEntity)((byte)this_00[0x70] | 1);
          }
          *(undefined4 *)(this_00 + 0x1ff8) = 0;
        }
        iVar4 = CSoundEnt::ClientSoundIndex(param_1);
        this_01 = (CSound *)CSoundEnt::SoundPointerForIndex(iVar4);
        if (this_01 != (CSound *)0x0) {
          CSound::Reset(this_01);
        }
        CBaseEntity::RemoveFlag(this_00,0x10000);
        CBaseEntity::AddFlag(this_00,0x400000);
        CBaseEntity::AddFlag(this_00,0x8000);
        in_stack_ffffffe8 = (CBaseEntity *)(uint)(*(ushort *)(this_00 + 0x1b4) | 4);
        CCollisionProperty::SetSolidFlags
                  ((CCollisionProperty *)(this_00 + 0x194),(int)in_stack_ffffffe8);
        if (g_pGameRules != (int *)0x0) {
          (**(code **)(*g_pGameRules + 0xe8))(g_pGameRules,param_1);
          in_stack_ffffffe8 = this_00;
          (**(code **)(*(int *)gamestats + 0x54))(gamestats);
        }
      }
      CBaseEntity::PhysicsRemoveTouchedList(this_00);
      CBaseEntity::PhysicsRemoveGroundList(this_00,in_stack_ffffffe8);
      CBasePlayer::ClearPlayerSimulationList((CBasePlayer *)this_00);
      return;
    }
  }
  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)