SavedTerrorGun::PreSpawn
0x00867120 · 477 bytes · __thiscall
_ZN14SavedTerrorGun8PreSpawnEP11CBaseEntity
Decompiled
undefined (2 params)
/* SavedTerrorGun::PreSpawn(CBaseEntity*) */
void __thiscall SavedTerrorGun::PreSpawn(SavedTerrorGun *this,CBaseEntity *param_1)
{
CBaseEdict *this_00;
char *pcVar1;
int iVar2;
int iVar3;
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_20[0] = DAT_01053d44;
local_28 = vec3_angle;
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_24 = DAT_01053d4c;
local_28 = vec3_origin;
local_20[0] = DAT_01053d50;
sscanf(pcVar1,"%f %f %f",(Vector *)&local_28,&local_24,local_20);
CBaseEntity::SetAbsVelocity(param_1,(Vector *)&local_28);
if (param_1 != (CBaseEntity *)0x0) {
iVar2 = __dynamic_cast(param_1,&CBaseEntity::typeinfo,&CTerrorGun::typeinfo,0);
if (iVar2 != 0) {
iVar3 = KeyValues::GetInt(*(KeyValues **)(this + 4),"reloaded",0);
if ((iVar3 == 0) && (*(char *)(iVar2 + 0x17e2) != '\x01')) {
if (*(char *)(iVar2 + 0x6c) == '\0') {
this_00 = *(CBaseEdict **)(iVar2 + 0x30);
if (this_00 != (CBaseEdict *)0x0) {
*(uint *)this_00 = *(uint *)this_00 | 0x101;
iVar3 = CBaseEdict::GetChangeAccessor(this_00);
*(undefined2 *)(iVar3 + 2) = 0;
}
*(undefined1 *)(iVar2 + 0x17e2) = 1;
}
else {
*(byte *)(iVar2 + 0x70) = *(byte *)(iVar2 + 0x70) | 1;
*(undefined1 *)(iVar2 + 0x17e2) = 1;
}
}
}
}
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.