CPropDoorRotatingBreakable::PrecacheBreakables
0x007fc9f0 · 530 bytes · __thiscall
_ZN26CPropDoorRotatingBreakable18PrecacheBreakablesEv
Decompiled
undefined (1 param)
/* CPropDoorRotatingBreakable::PrecacheBreakables() */
void __thiscall CPropDoorRotatingBreakable::PrecacheBreakables(CPropDoorRotatingBreakable *this)
{
char cVar1;
KeyValues *this_00;
undefined4 uVar2;
char *pcVar3;
char *pcVar4;
KeyValues *this_01;
int iVar5;
int iVar6;
int in_GS_OFFSET;
uint in_stack_ffffff68;
KeyValues *local_84;
undefined4 local_80;
undefined **local_7c;
undefined1 local_78;
char local_77 [83];
undefined4 local_24;
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
this_00 = KeyValues::operator_new((KeyValues *)0x2c,in_stack_ffffff68);
/* try { // try from 007fca37 to 007fca3b has its CatchHandler @ 007fcc15 */
KeyValues::KeyValues(this_00,"",(IKeyValuesSystem *)0x0,false);
uVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
pcVar3 = (char *)(**(code **)(*modelinfo + 0x10))(modelinfo,uVar2);
pcVar4 = (char *)(**(code **)(*modelinfo + 0x54))(modelinfo,uVar2);
cVar1 = KeyValues::LoadFromBuffer(this_00,pcVar3,pcVar4,(IBaseFileSystem *)0x0,(char *)0x0);
if (cVar1 == '\0') {
DevMsg("Breakable door %s has no KeyValues\n",pcVar3);
}
else {
this_01 = (KeyValues *)KeyValues::FindKey(this_00,"door_options",false);
if (this_01 == (KeyValues *)0x0) {
DevMsg("Breakable door %s has no door_options\n",pcVar3);
}
else {
local_7c = &PTR_InitQuietTruncation_00cc5b10;
local_78 = 1;
local_77[0] = '\0';
local_24 = 0;
pcVar3 = (char *)CFmtStrN<80>::sprintf
((CFmtStrN<80> *)&local_7c,"skin%d",*(undefined4 *)(this + 0x458));
local_84 = (KeyValues *)KeyValues::FindKey(this_01,pcVar3,false);
if ((local_84 != (KeyValues *)0x0) ||
(local_84 = (KeyValues *)KeyValues::FindKey(this_01,"defaults",false),
local_84 != (KeyValues *)0x0)) {
iVar5 = 1;
while( true ) {
pcVar3 = (char *)CFmtStrN<80>::sprintf((CFmtStrN<80> *)&local_7c,"damage%d",iVar5);
iVar6 = KeyValues::GetString(local_84,pcVar3,(char *)0x0);
if (iVar6 == 0) break;
CFmtStrN<80>::sprintf((CFmtStrN<80> *)&local_7c,"models/%s.mdl",iVar6);
V_FixSlashes(local_77,'/');
pcVar3 = local_77;
AllocPooledString((char *)&local_80);
PropBreakablePrecacheAll(local_80,pcVar3);
iVar5 = iVar5 + 1;
}
}
}
}
KeyValues::deleteThis();
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail(this_00);
}
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.