L L4D2node

SavedWeaponSpawn::SavedWeaponSpawn

0x00868670 · 918 bytes · __thiscall

_ZN16SavedWeaponSpawnC2EP12CWeaponSpawn

Decompiled

undefined (2 params)

/* SavedWeaponSpawn::SavedWeaponSpawn(CWeaponSpawn*) */

void __thiscall SavedWeaponSpawn::SavedWeaponSpawn(SavedWeaponSpawn *this,CWeaponSpawn *param_1)

{
  KeyValues *this_00;
  char *pcVar1;
  undefined1 *puVar2;
  int iVar3;
  int in_GS_OFFSET;
  uint in_stack_ffffff98;
  double local_44;
  double local_3c;
  char *local_30 [3];
  Color local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  *(undefined ***)this = &PTR__SavedEntity_00cda8a0;
  this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffff98);
                    /* try { // try from 008686b9 to 008686bd has its CatchHandler @ 00868a15 */
  KeyValues::KeyValues(this_00,"item",(IKeyValuesSystem *)0x0,false);
  *(KeyValues **)(this + 4) = this_00;
  pcVar1 = "";
  if (*(char **)(param_1 + 0x7c) != (char *)0x0) {
    pcVar1 = *(char **)(param_1 + 0x7c);
  }
  KeyValues::SetString(this_00,"classname",pcVar1);
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  pcVar1 = (char *)UTIL_VarArgs("%f %f %f",SUB84((double)*(float *)(param_1 + 0x2e0),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x2e0) >> 0x20),
                                SUB84((double)*(float *)(param_1 + 0x2e4),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x2e4) >> 0x20),
                                SUB84((double)*(float *)(param_1 + 0x2e8),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x2e8) >> 0x20));
  KeyValues::SetString(*(KeyValues **)(this + 4),"pos",pcVar1);
  if (((byte)param_1[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
  }
  pcVar1 = (char *)UTIL_VarArgs("%f %f %f",SUB84((double)*(float *)(param_1 + 0x37c),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x37c) >> 0x20),
                                SUB84((double)*(float *)(param_1 + 0x380),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x380) >> 0x20),
                                SUB84((double)*(float *)(param_1 + 900),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 900) >> 0x20));
  KeyValues::SetString(*(KeyValues **)(this + 4),"angles",pcVar1);
  if (((byte)param_1[0x14d] & 0x10) != 0) {
    CBaseEntity::CalcAbsoluteVelocity((CBaseEntity *)param_1);
  }
  pcVar1 = (char *)UTIL_VarArgs("%f %f %f",SUB84((double)*(float *)(param_1 + 0x274),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x274) >> 0x20),
                                SUB84((double)*(float *)(param_1 + 0x278),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x278) >> 0x20),
                                SUB84((double)*(float *)(param_1 + 0x27c),0),
                                (int)((ulonglong)(double)*(float *)(param_1 + 0x27c) >> 0x20));
  KeyValues::SetString(*(KeyValues **)(this + 4),"vel",pcVar1);
  *(undefined ***)this = &PTR__SavedWeaponSpawn_00cda8b8;
                    /* try { // try from 00868821 to 00868974 has its CatchHandler @ 00868a27 */
  (**(code **)(*(int *)param_1 + 0x20))(local_30,param_1);
  pcVar1 = "";
  if (local_30[0] != (char *)0x0) {
    pcVar1 = local_30[0];
  }
  if (((byte)param_1[0x14d] & 8) == 0) {
    local_3c = (double)*(float *)(param_1 + 0x2e8);
  }
  else {
                    /* try { // try from 008689a3 to 008689f1 has its CatchHandler @ 00868a27 */
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
    local_3c = (double)*(float *)(param_1 + 0x2e8);
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
      local_44 = (double)*(float *)(param_1 + 0x2e4);
      if (((byte)param_1[0x14d] & 8) != 0) {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
      }
      goto LAB_00868861;
    }
  }
  local_44 = (double)*(float *)(param_1 + 0x2e4);
LAB_00868861:
  puVar2 = &DAT_00d539c2;
  if (*(undefined1 **)(param_1 + 0x7c) != (undefined1 *)0x0) {
    puVar2 = *(undefined1 **)(param_1 + 0x7c);
  }
  local_24 = 0;
  local_23 = 0xff;
  local_22 = 0xc0;
  local_21 = 0xff;
  ConColorMsg(&local_24,"Saving %s at %.0f, %.0f, %.0f (model %s)\n",puVar2,
              SUB84((double)*(float *)(param_1 + 0x2e0),0),
              (int)((ulonglong)(double)*(float *)(param_1 + 0x2e0) >> 0x20),SUB84(local_44,0),
              (int)((ulonglong)local_44 >> 0x20),SUB84(local_3c,0),
              (int)((ulonglong)local_3c >> 0x20),pcVar1);
  KeyValues::SetInt(*(KeyValues **)(this + 4),"itemCount",*(int *)(param_1 + 0x144c));
  KeyValues::SetInt(*(KeyValues **)(this + 4),"shadow",(uint)(((byte)param_1[0xd4] & 0x10) == 0));
  (**(code **)(*(int *)param_1 + 0x20))(local_30,param_1);
  pcVar1 = "";
  if (local_30[0] != (char *)0x0) {
    pcVar1 = local_30[0];
  }
  KeyValues::SetString(*(KeyValues **)(this + 4),"model",pcVar1);
  iVar3 = (**(code **)(*(int *)param_1 + 0x3cc))(param_1);
  KeyValues::SetInt(*(KeyValues **)(this + 4),"weaponID",iVar3);
  KeyValues::SetInt(*(KeyValues **)(this + 4),"weaponskin",*(int *)(param_1 + 0x1450));
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)