L L4D2node

CBaseCombatWeapon::Respawn

0x005fe280 · 386 bytes · __thiscall

_ZN17CBaseCombatWeapon7RespawnEv

Decompiled

undefined (1 param)

/* CBaseCombatWeapon::Respawn() */

CBaseEntity * __thiscall CBaseCombatWeapon::Respawn(CBaseCombatWeapon *this)

{
  float fVar1;
  uint uVar2;
  char *pcVar3;
  undefined *puVar4;
  CBaseEntity *pCVar5;
  undefined1 *puVar6;
  longdouble lVar7;
  undefined4 uVar8;
  undefined4 uVar9;
  undefined4 uVar10;
  undefined4 uVar11;
  undefined1 local_34 [12];
  Vector local_28 [24];
  
  pCVar5 = (CBaseEntity *)0x0;
  uVar2 = *(uint *)(this + 0x220);
  if (((uVar2 != 0xffffffff) &&
      (puVar4 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar4 + 8) == uVar2 >> 0xc)) {
    pCVar5 = *(CBaseEntity **)(puVar4 + 4);
  }
  (**(code **)(*g_pGameRules + 0x15c))(local_28,g_pGameRules,this);
  pcVar3 = *(char **)(this + 0x7c);
  if (pcVar3 == (char *)0x0) {
    pcVar3 = "";
  }
  pCVar5 = (CBaseEntity *)CBaseEntity::Create(pcVar3,local_28,(QAngle *)(this + 0x3a8),pCVar5);
  if (pCVar5 != (CBaseEntity *)0x0) {
    CBaseEntity::AddEffects(pCVar5,0x20);
    *(undefined4 *)(pCVar5 + 0xd8) = 0;
    *(undefined4 *)(pCVar5 + 0xdc) = 0;
    uVar11 = 0;
    uVar10 = 0;
    uVar9 = 0;
    CBaseEntity::ThinkSet((_func_void *)local_34,(float)pCVar5,(char *)AttemptToMaterialize);
    uVar8 = 0;
    UTIL_DropToFloor((CBaseEntity *)this,0x200400b,(CBaseEntity *)0x0);
    fVar1 = *(float *)(gpGlobals + 0xc);
    lVar7 = (longdouble)
            (**(code **)(*g_pGameRules + 0x154))(g_pGameRules,this,uVar8,uVar9,uVar10,uVar11);
    CBaseEntity::SetNextThink(pCVar5,(float)lVar7 + fVar1,(char *)0x0);
    return pCVar5;
  }
  puVar6 = &DAT_00d539c2;
  if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
    puVar6 = *(undefined1 **)(this + 0x7c);
  }
  Warning("Respawn failed to create %s!\n",puVar6);
  return (CBaseEntity *)0x0;
}

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)