L L4D2node

CTerrorWeapon::GiveThink

0x0056c460 · 274 bytes · __thiscall

_ZN13CTerrorWeapon9GiveThinkEv

Decompiled

undefined (1 param)

/* CTerrorWeapon::GiveThink() */

void __thiscall CTerrorWeapon::GiveThink(CTerrorWeapon *this)

{
  uint uVar1;
  CTerrorPlayer *this_00;
  code *pcVar2;
  char cVar3;
  int iVar4;
  int *piVar5;
  undefined4 uVar6;
  undefined *puVar7;
  
  uVar1 = *(uint *)(this + 0x179c);
  if (uVar1 == 0xffffffff) {
    return;
  }
  puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10;
  if (puVar7 == (undefined *)0xfffffffc) {
    return;
  }
  if (*(uint *)(puVar7 + 8) != uVar1 >> 0xc) {
    return;
  }
  this_00 = *(CTerrorPlayer **)(puVar7 + 4);
  if (this_00 == (CTerrorPlayer *)0x0) {
    return;
  }
  cVar3 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
  if (cVar3 == '\0') {
    return;
  }
  iVar4 = CBaseCombatWeapon::GetOwner((CBaseCombatWeapon *)this);
  if (iVar4 != 0) {
    return;
  }
  cVar3 = (**(code **)(*(int *)this + 0x608))(this,this_00);
  if (cVar3 == '\0') {
    return;
  }
  cVar3 = (**(code **)(*(int *)this_00 + 0x6ac))(this_00,this);
  if (cVar3 == '\0') {
    iVar4 = (**(code **)(*(int *)this + 0x5e0))(this);
    if (iVar4 != 0) {
      piVar5 = (int *)(**(code **)(*(int *)this + 0x5e0))(this);
      if ((piVar5 == (int *)0x0) || (cVar3 = (**(code **)(*piVar5 + 0x16c))(piVar5), cVar3 == '\0'))
      {
        piVar5 = (int *)0x0;
      }
      cVar3 = (**(code **)(*piVar5 + 0x6ac))(piVar5,this);
      if (cVar3 != '\0') {
        pcVar2 = *(code **)(*(int *)this + 0x4e4);
        uVar6 = (**(code **)(*(int *)this + 0x5e0))(this);
        (*pcVar2)(this,uVar6);
      }
      return;
    }
    return;
  }
  (**(code **)(*(int *)this + 0x4e4))(this,this_00);
  CTerrorPlayer::OnGivenWeapon(this_00,this);
  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)