L L4D2node

CGameUI::InputActivate

0x006d25b0 · 1104 bytes · __thiscall

_ZN7CGameUI13InputActivateER11inputdata_t

Decompiled

undefined (2 params)

/* CGameUI::InputActivate(inputdata_t&) */

void __thiscall CGameUI::InputActivate(CGameUI *this,inputdata_t *param_1)

{
  char cVar1;
  undefined4 *puVar2;
  uint uVar3;
  int *piVar4;
  undefined1 *puVar5;
  CBasePlayer *this_00;
  undefined *puVar6;
  undefined1 *puVar7;
  int iVar8;
  CBaseCombatCharacter *pCVar9;
  CBaseEntity *pCVar10;
  uint uVar11;
  
  if ((*(int *)(param_1 + 0x18) == 2) && (*(char **)(param_1 + 8) != (char *)0x0)) {
    pCVar10 = (CBaseEntity *)
              CGlobalEntityList::FindEntityByName
                        ((CGlobalEntityList *)gEntList,(CBaseEntity *)0x0,*(char **)(param_1 + 8),
                         (CBaseEntity *)this,*(CBaseEntity **)param_1,*(CBaseEntity **)(param_1 + 4)
                         ,(IEntityFindFilter *)0x0);
    if ((pCVar10 == (CBaseEntity *)0x0) ||
       (cVar1 = (**(code **)(*(int *)pCVar10 + 0x16c))(pCVar10), cVar1 == '\0')) {
      if (*(int *)(param_1 + 0x18) == 2) {
        puVar5 = &DAT_00d539c2;
        if (*(undefined1 **)(param_1 + 8) != (undefined1 *)0x0) {
          puVar5 = *(undefined1 **)(param_1 + 8);
        }
      }
      else {
        puVar5 = (undefined1 *)variant_t::ToString((variant_t *)(param_1 + 8));
      }
      puVar7 = &DAT_00d539c2;
      if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
        puVar7 = *(undefined1 **)(this + 0x154);
      }
      Warning("%s InputActivate: entity %s not found or is not a player!\n",puVar7,puVar5);
      return;
    }
LAB_006d2906:
    cVar1 = (**(code **)(*(int *)pCVar10 + 0x16c))(pCVar10);
    if (cVar1 == '\0') {
      pCVar10 = (CBaseEntity *)0x0;
    }
  }
  else {
    piVar4 = *(int **)param_1;
    if ((piVar4 == (int *)0x0) || (cVar1 = (**(code **)(*piVar4 + 0x16c))(piVar4), cVar1 == '\0')) {
      Warning();
      return;
    }
    pCVar10 = *(CBaseEntity **)param_1;
    if (pCVar10 != (CBaseEntity *)0x0) goto LAB_006d2906;
    pCVar10 = (CBaseEntity *)0x0;
  }
  uVar3 = *(uint *)(this + 0x600);
  if ((((uVar3 == 0xffffffff) ||
       (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar6 + 8) != uVar3 >> 0xc)) ||
     (*(CBaseEntity **)(puVar6 + 4) == (CBaseEntity *)0x0)) {
    if (pCVar10 == (CBaseEntity *)0x0) {
      *(undefined4 *)(this + 0x600) = 0xffffffff;
      goto LAB_006d263e;
    }
  }
  else if (pCVar10 != *(CBaseEntity **)(puVar6 + 4)) {
    return;
  }
  puVar2 = (undefined4 *)(**(code **)(*(int *)pCVar10 + 0xc))(pCVar10);
  *(undefined4 *)(this + 0x600) = *puVar2;
LAB_006d263e:
  COutputEvent::FireOutput((COutputEvent *)(this + 0x448),pCVar10,(CBaseEntity *)this,0.0);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  uVar3 = *(uint *)(this + 0x148);
  if ((uVar3 & 0x20) != 0) {
    uVar3 = *(uint *)(this + 0x600);
    pCVar10 = (CBaseEntity *)0x0;
    if (((uVar3 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
      pCVar10 = *(CBaseEntity **)(puVar6 + 4);
    }
    CBaseEntity::AddFlag(pCVar10,0x40);
    uVar3 = *(uint *)(this + 0x148);
  }
  if ((uVar3 & 0x40) != 0) {
    uVar3 = *(uint *)(this + 0x600);
    iVar8 = 0;
    if (((uVar3 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
      iVar8 = *(int *)(puVar6 + 4);
    }
    uVar11 = *(uint *)(iVar8 + 0x1a7c) | 1;
    if (*(uint *)(iVar8 + 0x1a7c) != uVar11) {
      (**(code **)(*(int *)(iVar8 + 0x1a40) + 4))(iVar8 + 0x1a40,iVar8 + 0x1a7c);
      *(uint *)(iVar8 + 0x1a7c) = uVar11;
      uVar3 = *(uint *)(this + 0x600);
    }
    pCVar9 = (CBaseCombatCharacter *)0x0;
    if (((uVar3 != 0xffffffff) &&
        (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
      pCVar9 = *(CBaseCombatCharacter **)(puVar6 + 4);
    }
    iVar8 = CBaseCombatCharacter::GetActiveWeapon(pCVar9);
    if (iVar8 != 0) {
      uVar3 = *(uint *)(this + 0x600);
      pCVar9 = (CBaseCombatCharacter *)0x0;
      if (((uVar3 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
        pCVar9 = *(CBaseCombatCharacter **)(puVar6 + 4);
      }
      piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon(pCVar9);
      if (piVar4 == (int *)0x0) {
        *(undefined4 *)(this + 0x444) = 0xffffffff;
      }
      else {
        puVar2 = (undefined4 *)(**(code **)(*piVar4 + 0xc))(piVar4);
        *(undefined4 *)(this + 0x444) = *puVar2;
      }
      uVar3 = *(uint *)(this + 0x600);
      pCVar9 = (CBaseCombatCharacter *)0x0;
      if (((uVar3 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
        pCVar9 = *(CBaseCombatCharacter **)(puVar6 + 4);
      }
      piVar4 = (int *)CBaseCombatCharacter::GetActiveWeapon(pCVar9);
      (**(code **)(*piVar4 + 0x428))(piVar4,0);
      uVar3 = *(uint *)(this + 0x600);
      pCVar9 = (CBaseCombatCharacter *)0x0;
      if (((uVar3 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
        pCVar9 = *(CBaseCombatCharacter **)(puVar6 + 4);
      }
      CBaseCombatCharacter::SetActiveWeapon(pCVar9,(CBaseCombatWeapon *)0x0);
      uVar3 = *(uint *)(this + 0x600);
      this_00 = (CBasePlayer *)0x0;
      if (((uVar3 != 0xffffffff) &&
          (puVar6 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar6 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar6 + 8) == uVar3 >> 0xc)) {
        this_00 = *(CBasePlayer **)(puVar6 + 4);
      }
      CBasePlayer::HideViewModels(this_00);
    }
  }
  this[0x5f8] = (CGameUI)0x1;
  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)