SavedTerrorMeleeWeapon::PreSpawn
0x00867300 · 438 bytes · __thiscall
_ZN22SavedTerrorMeleeWeapon8PreSpawnEP11CBaseEntity
Decompiled
undefined (2 params)
/* SavedTerrorMeleeWeapon::PreSpawn(CBaseEntity*) */
void __thiscall SavedTerrorMeleeWeapon::PreSpawn(SavedTerrorMeleeWeapon *this,CBaseEntity *param_1)
{
int iVar1;
CTerrorMeleeWeapon *this_00;
int iVar2;
char *pcVar3;
undefined4 local_28;
undefined4 local_24;
undefined4 local_20 [4];
iVar1 = KeyValues::GetInt(*(KeyValues **)(this + 4),"melee_weapon",0);
if (param_1 != (CBaseEntity *)0x0) {
this_00 = (CTerrorMeleeWeapon *)
__dynamic_cast(param_1,&CBaseEntity::typeinfo,&CTerrorMeleeWeapon::typeinfo,0);
if (this_00 != (CTerrorMeleeWeapon *)0x0) {
iVar2 = CMeleeWeaponInfoStore::GetInvalidHandle();
if (iVar2 != iVar1) {
CTerrorMeleeWeapon::SetMeleeWeaponInfoHandle(this_00,iVar1);
}
}
}
pcVar3 = (char *)KeyValues::GetString(*(KeyValues **)(this + 4),"pos","");
local_28 = vec3_origin;
local_24 = DAT_01053d4c;
local_20[0] = DAT_01053d50;
sscanf(pcVar3,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
CBaseEntity::SetAbsOrigin(param_1,(Vector *)&local_28);
pcVar3 = (char *)KeyValues::GetString(*(KeyValues **)(this + 4),"angles","");
local_24 = DAT_01053d40;
local_28 = vec3_angle;
local_20[0] = DAT_01053d44;
sscanf(pcVar3,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
CBaseEntity::SetAbsAngles(param_1,(QAngle *)&local_28);
pcVar3 = (char *)KeyValues::GetString(*(KeyValues **)(this + 4),"vel","");
local_28 = vec3_origin;
local_24 = DAT_01053d4c;
local_20[0] = DAT_01053d50;
sscanf(pcVar3,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
CBaseEntity::SetAbsVelocity(param_1,(Vector *)&local_28);
return;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.