L L4D2node

SavedEntity::PreSpawn

0x00866fd0 · 329 bytes · __thiscall

_ZN11SavedEntity8PreSpawnEP11CBaseEntity

Decompiled

undefined (2 params)

/* SavedEntity::PreSpawn(CBaseEntity*) */

void __thiscall SavedEntity::PreSpawn(SavedEntity *this,CBaseEntity *param_1)

{
  char *pcVar1;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20 [4];
  
  pcVar1 = (char *)KeyValues::GetString(*(KeyValues **)(this + 4),"pos","");
  local_28 = vec3_origin;
  local_24 = DAT_01053d4c;
  local_20[0] = DAT_01053d50;
  sscanf(pcVar1,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
  CBaseEntity::SetAbsOrigin(param_1,(Vector *)&local_28);
  pcVar1 = (char *)KeyValues::GetString(*(KeyValues **)(this + 4),"angles","");
  local_28 = vec3_angle;
  local_20[0] = DAT_01053d44;
  local_24 = DAT_01053d40;
  sscanf(pcVar1,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
  CBaseEntity::SetAbsAngles(param_1,(QAngle *)&local_28);
  pcVar1 = (char *)KeyValues::GetString(*(KeyValues **)(this + 4),"vel","");
  local_28 = vec3_origin;
  local_24 = DAT_01053d4c;
  local_20[0] = DAT_01053d50;
  sscanf(pcVar1,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
  CBaseEntity::SetAbsVelocity(param_1,(Vector *)&local_28);
  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)