L L4D2node

CVGuiScreen::SetPlayerOwner

0x00b3ee40 · 307 bytes · __thiscall

_ZN11CVGuiScreen14SetPlayerOwnerEP11CBasePlayerb

Decompiled

undefined (3 params)

/* CVGuiScreen::SetPlayerOwner(CBasePlayer*, bool) */

void __thiscall CVGuiScreen::SetPlayerOwner(CVGuiScreen *this,CBasePlayer *param_1,bool param_2)

{
  uint uVar1;
  CBaseEdict *pCVar2;
  uint *puVar3;
  undefined *puVar4;
  int iVar5;
  uint uVar6;
  int iVar7;
  
  if (param_1 == (CBasePlayer *)0x0) {
    uVar6 = 0xffffffff;
    iVar7 = 0;
  }
  else {
    puVar3 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    uVar6 = *puVar3;
    if (((uVar6 == 0xffffffff) ||
        (puVar4 = g_pEntityList + (uVar6 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar4 + 8) != uVar6 >> 0xc)) {
      iVar7 = 0;
    }
    else {
      iVar7 = *(int *)(puVar4 + 4);
    }
  }
  uVar1 = *(uint *)(this + 0x45c);
  if (((uVar1 == 0xffffffff) ||
      (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
     (*(uint *)(puVar4 + 8) != uVar1 >> 0xc)) {
    iVar5 = 0;
  }
  else {
    iVar5 = *(int *)(puVar4 + 4);
  }
  if (iVar7 != iVar5) {
    if (this[0x6c] == (CVGuiScreen)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar7 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CVGuiScreen)((byte)this[0x70] | 1);
    }
    *(uint *)(this + 0x45c) = uVar6;
  }
  if ((param_2) && (*(int *)(this + 0x458) != 0x10)) {
    if (this[0x6c] == (CVGuiScreen)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar7 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar7 + 2) = 0;
      }
      *(undefined4 *)(this + 0x458) = 0x10;
    }
    else {
      this[0x70] = (CVGuiScreen)((byte)this[0x70] | 1);
      *(undefined4 *)(this + 0x458) = 0x10;
    }
  }
  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)