L L4D2node

CGameUI::Deactivate

0x006d2ca0 · 939 bytes · __thiscall

_ZN7CGameUI10DeactivateEP11CBaseEntity

Decompiled

undefined (2 params)

/* CGameUI::Deactivate(CBaseEntity*) */

void __thiscall CGameUI::Deactivate(CGameUI *this,CBaseEntity *param_1)

{
  CBaseEntity *this_00;
  undefined1 *puVar1;
  int iVar2;
  int *piVar3;
  undefined1 *puVar4;
  undefined *puVar5;
  undefined *puVar6;
  uint uVar7;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar7 = *(uint *)(this + 0x600);
  if ((((uVar7 == 0xffffffff) ||
       (puVar6 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar6 + 8) != uVar7 >> 0xc)) ||
     (this_00 = *(CBaseEntity **)(puVar6 + 4), this_00 == (CBaseEntity *)0x0)) {
    puVar4 = *(undefined1 **)(param_1 + 0x154);
    if (puVar4 == (undefined1 *)0x0) {
      puVar4 = &DAT_00d539c2;
    }
    puVar1 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
      puVar1 = *(undefined1 **)(this + 0x154);
    }
    Warning("%s Deactivate(): I have no player when called by %s!\n",puVar1,puVar4);
  }
  else {
    uVar7 = *(uint *)(this + 0x148);
    if ((uVar7 & 0x20) != 0) {
      CBaseEntity::RemoveFlag(this_00,0x40);
      uVar7 = *(uint *)(this + 0x148);
    }
    if ((uVar7 & 0x40) != 0) {
      uVar7 = *(uint *)(this_00 + 0x1a7c) & 0xfffffffe;
      if (*(uint *)(this_00 + 0x1a7c) != uVar7) {
        (**(code **)(*(int *)(this_00 + 0x1a40) + 4))(this_00 + 0x1a40,this_00 + 0x1a7c);
        *(uint *)(this_00 + 0x1a7c) = uVar7;
      }
      uVar7 = *(uint *)(this + 0x444);
      if (((uVar7 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         ((*(uint *)(puVar6 + 8) == uVar7 >> 0xc && (*(int *)(puVar6 + 4) != 0)))) {
        uVar7 = *(uint *)(this + 0x600);
        piVar3 = (int *)0x0;
        if (((uVar7 != 0xffffffff) &&
            (puVar5 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar5 != (undefined *)0xfffffffc)) &&
           (*(uint *)(puVar5 + 8) == uVar7 >> 0xc)) {
          piVar3 = *(int **)(puVar5 + 4);
        }
        (**(code **)(*piVar3 + 0x474))(piVar3,*(int *)(puVar6 + 4),0);
        *(undefined4 *)(this + 0x444) = 0xffffffff;
      }
      iVar2 = CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_00);
      if (iVar2 != 0) {
        piVar3 = (int *)CBaseCombatCharacter::GetActiveWeapon((CBaseCombatCharacter *)this_00);
        (**(code **)(*piVar3 + 0x424))(piVar3);
      }
    }
    COutputEvent::FireOutput((COutputEvent *)(this + 0x460),this_00,(CBaseEntity *)this,0.0);
    local_40 = 0;
    variant_t::Set((variant_t *)(this + 0x598),1,&local_40);
    local_30 = *(undefined4 *)(this + 0x598);
    local_2c = *(undefined4 *)(this + 0x59c);
    local_28 = *(undefined4 *)(this + 0x5a0);
    local_24 = *(undefined4 *)(this + 0x5a4);
    local_20 = *(undefined4 *)(this + 0x5a8);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x598),&local_30,this_00,this,0);
    local_3c = 0;
    variant_t::Set((variant_t *)(this + 0x5b0),1,&local_3c);
    local_30 = *(undefined4 *)(this + 0x5b0);
    local_2c = *(undefined4 *)(this + 0x5b4);
    local_28 = *(undefined4 *)(this + 0x5b8);
    local_24 = *(undefined4 *)(this + 0x5bc);
    local_20 = *(undefined4 *)(this + 0x5c0);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x5b0),&local_30,this_00,this,0);
    local_38 = 0;
    variant_t::Set((variant_t *)(this + 0x5c8),1,&local_38);
    local_30 = *(undefined4 *)(this + 0x5c8);
    local_2c = *(undefined4 *)(this + 0x5cc);
    local_28 = *(undefined4 *)(this + 0x5d0);
    local_24 = *(undefined4 *)(this + 0x5d4);
    local_20 = *(undefined4 *)(this + 0x5d8);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x5c8),&local_30,this_00,this,0);
    local_34 = 0;
    variant_t::Set((variant_t *)(this + 0x5e0),1,&local_34);
    local_30 = *(undefined4 *)(this + 0x5e0);
    local_2c = *(undefined4 *)(this + 0x5e4);
    local_28 = *(undefined4 *)(this + 0x5e8);
    local_24 = *(undefined4 *)(this + 0x5ec);
    local_20 = *(undefined4 *)(this + 0x5f0);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x5e0),&local_30,this_00,this,0);
    *(undefined4 *)(this + 0x5fc) = 0;
    *(undefined4 *)(this + 0x600) = 0xffffffff;
  }
  CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
  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)