L L4D2node

CPointScriptUseTarget::Think

0x00902e70 · 556 bytes · __thiscall

_ZN21CPointScriptUseTarget5ThinkEv

Decompiled

undefined (1 param)

/* CPointScriptUseTarget::Think() */

void __thiscall CPointScriptUseTarget::Think(CPointScriptUseTarget *this)

{
  float fVar1;
  uint uVar2;
  CCSPlayer *this_00;
  int *piVar3;
  char cVar4;
  int iVar5;
  int iVar6;
  undefined *puVar7;
  longdouble lVar8;
  
  uVar2 = *(uint *)(this + 0x478);
  if ((((uVar2 == 0xffffffff) ||
       (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 == (undefined *)0xfffffffc)) ||
      (*(uint *)(puVar7 + 8) != uVar2 >> 0xc)) ||
     (this_00 = *(CCSPlayer **)(puVar7 + 4), this_00 == (CCSPlayer *)0x0)) {
    return;
  }
  if ((this[0x464] != (CPointScriptUseTarget)0x0) &&
     (cVar4 = CTerrorPlayer::IsAdrenalineActive((CTerrorPlayer *)this_00), cVar4 == '\0')) {
    OnAdrenalineEnd(this);
  }
  fVar1 = *(float *)(gpGlobals + 0xc);
  lVar8 = (longdouble)CCSPlayer::GetProgressBarStartTime(this_00);
  cVar4 = CBasePlayer::IsDead((CBasePlayer *)this_00);
  if (((cVar4 == '\0') && (cVar4 = (**(code **)(*(int *)this_00 + 0x7e8))(this_00), cVar4 == '\0'))
     && ((((byte)this_00[0x1cb0] & 0x20) != 0 &&
         (iVar5 = CTerrorPlayer::GetCurrentUseAction((CTerrorPlayer *)this_00), iVar5 == 0xb)))) {
    iVar5 = 0;
    iVar6 = CTerrorPlayer::GetEntityIAmPerformingActionOn((CTerrorPlayer *)this_00);
    uVar2 = *(uint *)(this + 0x460);
    if (((uVar2 != 0xffffffff) &&
        (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) {
      iVar5 = *(int *)(puVar7 + 4);
    }
    if (iVar6 == iVar5) {
      if (fVar1 - (float)lVar8 < *(float *)(this + 0x458)) {
        CBaseEntity::SetNextThink
                  ((CBaseEntity *)this,*(float *)(gpGlobals + 0xc) + 0.033,(char *)0x0);
        return;
      }
      StopUse(this);
      COutputEvent::FireOutput
                ((COutputEvent *)(this + 0x494),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
      piVar3 = g_pScriptVM;
      if (*(int *)(this + 0x470) == 0) {
        return;
      }
      if (this[0x474] != (CPointScriptUseTarget)0x0) {
        return;
      }
      this[0x474] = (CPointScriptUseTarget)0x1;
      (**(code **)(*piVar3 + 0x50))
                (piVar3,*(int *)(this + 0x470),0,0,0,*(undefined4 *)(this + 1000),1);
      this[0x474] = (CPointScriptUseTarget)0x0;
      return;
    }
  }
  StopUse(this);
  COutputEvent::FireOutput
            ((COutputEvent *)(this + 0x4ac),(CBaseEntity *)this_00,(CBaseEntity *)this,0.0);
  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)