L L4D2node

CGameUI::Think

0x006d3080 · 1601 bytes · __thiscall

_ZN7CGameUI5ThinkEv

Decompiled

undefined (1 param)

/* CGameUI::Think() */

void __thiscall CGameUI::Think(CGameUI *this)

{
  CBasePlayer *this_00;
  float *pfVar1;
  undefined *puVar2;
  uint uVar3;
  float fVar4;
  float fVar5;
  float local_54;
  float local_50;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  uVar3 = *(uint *)(this + 0x600);
  if ((((uVar3 == 0xffffffff) ||
       (puVar2 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar2 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar2 + 8) != uVar3 >> 0xc)) ||
     (this_00 = *(CBasePlayer **)(puVar2 + 4), this_00 == (CBasePlayer *)0x0)) {
    CBaseEntity::SetNextThink((CBaseEntity *)this,-1.0,(char *)0x0);
    return;
  }
  if (this[0x5f8] != (CGameUI)0x0) {
    *(undefined4 *)(this + 0x5fc) = *(undefined4 *)(this_00 + 0x1cb0);
  }
  if (-1.0 < *(float *)(this + 0x440)) {
    CBasePlayer::EyeVectors(this_00,(Vector *)&local_3c,(Vector *)0x0,(Vector *)0x0);
    pfVar1 = (float *)(**(code **)(*(int *)this_00 + 0x288))(this_00);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    local_30 = *(float *)(this + 0x2e0) - *pfVar1;
    local_2c = *(float *)(this + 0x2e4) - pfVar1[1];
    local_28 = *(float *)(this + 0x2e8) - pfVar1[2];
    VectorNormalize((Vector *)&local_30);
    if (local_2c * local_38 + local_30 * local_3c + local_28 * local_34 < *(float *)(this + 0x440))
    goto LAB_006d31fc;
  }
  CBaseEntity::AddFlag((CBaseEntity *)this_00,8);
  CBaseEntity::SetNextThink((CBaseEntity *)this,*(float *)(gpGlobals + 0xc),(char *)0x0);
  if ((((*(uint *)(this_00 + 0x1cb4) & 0x20) != 0) && (((byte)this[0x148] & 0x80) != 0)) ||
     (((*(uint *)(this_00 + 0x1cb4) & 2) != 0 && (((byte)this[0x149] & 1) != 0)))) {
LAB_006d31fc:
    Deactivate(this,(CBaseEntity *)this_00);
    return;
  }
  uVar3 = *(uint *)(this_00 + 0x1cb0) ^ *(uint *)(this + 0x5fc);
  if ((uVar3 & 0x400) != 0) {
    if ((*(uint *)(this + 0x5fc) & 0x400) == 0) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x490),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
    else {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x520),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
  }
  if ((uVar3 & 0x200) != 0) {
    if (((byte)this[0x5fd] & 2) == 0) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x478),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
    else {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x508),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
  }
  if ((uVar3 & 8) != 0) {
    if (((byte)this[0x5fc] & 8) == 0) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x4a8),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
    else {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x538),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
  }
  if ((uVar3 & 0x10) != 0) {
    if (((byte)this[0x5fc] & 0x10) == 0) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x4c0),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
    else {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x550),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
  }
  if ((uVar3 & 1) != 0) {
    if (((byte)this[0x5fc] & 1) == 0) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x4d8),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
    else {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x568),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
  }
  if ((uVar3 & 0x800) != 0) {
    if (((byte)this[0x5fd] & 8) == 0) {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x4f0),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
    else {
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x580),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
    }
  }
  fVar5 = 1.0;
  *(undefined4 *)(this + 0x5fc) = *(undefined4 *)(this_00 + 0x1cb0);
  uVar3 = *(uint *)(this_00 + 0x1cb0);
  if (((uVar3 & 0x400) == 0) && (fVar5 = -1.0, (uVar3 & 0x200) == 0)) {
    fVar5 = 0.0;
  }
  fVar4 = 1.0;
  if (((uVar3 & 8) == 0) && (fVar4 = -1.0, (uVar3 & 0x10) == 0)) {
    fVar4 = 0.0;
  }
  local_50 = 1.0;
  if ((uVar3 & 1) == 0) {
    local_50 = 0.0;
  }
  local_54 = 0.0;
  if ((uVar3 & 0x800) != 0) {
    local_54 = 1.0;
  }
  if ((this[0x5f8] == (CGameUI)0x0) && (fVar5 == *(float *)(this + 0x598))) {
LAB_006d33f0:
    if (fVar4 != *(float *)(this + 0x5b0)) goto LAB_006d3400;
LAB_006d3640:
    if (local_50 != *(float *)(this + 0x5c8)) goto LAB_006d347e;
LAB_006d3620:
    if (local_54 == *(float *)(this + 0x5e0)) goto LAB_006d3577;
  }
  else {
    local_48 = fVar5;
    variant_t::Set((variant_t *)(this + 0x598),1,&local_48);
    local_30 = *(float *)(this + 0x598);
    local_2c = *(float *)(this + 0x59c);
    local_28 = *(float *)(this + 0x5a0);
    local_24 = *(undefined4 *)(this + 0x5a4);
    local_20 = *(undefined4 *)(this + 0x5a8);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x598),&local_30,this_00,this,0);
    if (this[0x5f8] == (CGameUI)0x0) goto LAB_006d33f0;
LAB_006d3400:
    local_44 = fVar4;
    variant_t::Set((variant_t *)(this + 0x5b0),1,&local_44);
    local_30 = *(float *)(this + 0x5b0);
    local_2c = *(float *)(this + 0x5b4);
    local_28 = *(float *)(this + 0x5b8);
    local_24 = *(undefined4 *)(this + 0x5bc);
    local_20 = *(undefined4 *)(this + 0x5c0);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x5b0),&local_30,this_00,this,0);
    if (this[0x5f8] == (CGameUI)0x0) goto LAB_006d3640;
LAB_006d347e:
    local_40 = local_50;
    variant_t::Set((variant_t *)(this + 0x5c8),1,&local_40);
    local_30 = *(float *)(this + 0x5c8);
    local_2c = *(float *)(this + 0x5cc);
    local_28 = *(float *)(this + 0x5d0);
    local_24 = *(undefined4 *)(this + 0x5d4);
    local_20 = *(undefined4 *)(this + 0x5d8);
    CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x5c8),&local_30,this_00,this,0);
    if (this[0x5f8] == (CGameUI)0x0) goto LAB_006d3620;
  }
  local_3c = local_54;
  variant_t::Set((variant_t *)(this + 0x5e0),1,&local_3c);
  local_30 = *(float *)(this + 0x5e0);
  local_2c = *(float *)(this + 0x5e4);
  local_28 = *(float *)(this + 0x5e8);
  local_24 = *(undefined4 *)(this + 0x5ec);
  local_20 = *(undefined4 *)(this + 0x5f0);
  CBaseEntityOutput::FireOutput((CBaseEntityOutput *)(this + 0x5e0),&local_30,this_00,this,0);
LAB_006d3577:
  this[0x5f8] = (CGameUI)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)