SpawnAllEntities
0x006f02c0 · 1250 bytes · __cdecl
_Z16SpawnAllEntitiesiP19HierarchicalSpawn_tb
Decompiled
undefined (3 params)
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* SpawnAllEntities(int, HierarchicalSpawn_t*, bool) */
void SpawnAllEntities(int param_1,HierarchicalSpawn_t *param_2,bool param_3)
{
CBaseEntity *pCVar1;
int *piVar2;
int *piVar3;
bool bVar4;
HierarchicalSpawn_t *pHVar5;
undefined1 uVar6;
char cVar7;
int iVar8;
CBaseAnimating *this;
undefined4 uVar9;
int iVar10;
HierarchicalSpawn_t *pHVar11;
int local_40;
undefined4 local_34;
undefined4 local_30;
undefined4 local_28;
undefined4 local_24;
int local_20;
if (0 < param_1) {
local_40 = 1;
pHVar5 = param_2;
do {
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/mapentities.cpp",0xfa,
&SpawnAllEntities(int,HierarchicalSpawn_t*,bool)::tm_fmt,"(%s)%s","Unaccounted",
"MapEntity_ParseAllEntities_Spawn");
local_20 = ___atan2f_finite;
}
iVar10 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 006f038a to 006f038e has its CatchHandler @ 006f07e2 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar8 = ThreadGetCurrentId(), iVar10 == iVar8)) {
if ((char *)*_DAT_0105d15c != "MapEntity_ParseAllEntities_Spawn") {
/* try { // try from 006f0560 to 006f0571 has its CatchHandler @ 006f07e2 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc9ce20,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
piVar3 = mdlcache;
pCVar1 = *(CBaseEntity **)pHVar5;
if (*(int *)(pHVar5 + 8) == 0) {
if (pCVar1 != (CBaseEntity *)0x0) goto LAB_006f03fb;
}
else {
/* try { // try from 006f03b0 to 006f03b2 has its CatchHandler @ 006f07fe */
(**(code **)(*mdlcache + 0x68))(mdlcache);
piVar2 = *(int **)(pHVar5 + 8);
/* try { // try from 006f03c0 to 006f03f2 has its CatchHandler @ 006f07e6 */
this = (CBaseAnimating *)(**(code **)(*piVar2 + 0xf0))(piVar2);
if (this == (CBaseAnimating *)0x0) {
uVar9 = 0xffffffff;
}
else {
uVar9 = CBaseAnimating::LookupAttachment(this,*(char **)(pHVar5 + 0xc));
}
(**(code **)(*(int *)pCVar1 + 0x98))(pCVar1,piVar2,uVar9);
(**(code **)(*piVar3 + 0x6c))(piVar3);
LAB_006f03fb:
/* try { // try from 006f0406 to 006f040a has its CatchHandler @ 006f07fe */
iVar10 = DispatchSpawn(pCVar1,true);
if (iVar10 < 0) {
pHVar11 = pHVar5 + 0x10;
if (local_40 < param_1) {
do {
if ((*(int *)pHVar11 != 0) && ((*(byte *)(*(int *)pHVar11 + 0x14c) & 1) != 0)) {
*(int *)pHVar11 = 0;
}
pHVar11 = pHVar11 + 0x10;
} while (pHVar11 != param_2 + param_1 * 0x10);
}
/* try { // try from 006f04eb to 006f04ef has its CatchHandler @ 006f07fe */
CGlobalEntityList::CleanupDeleteList();
*(int *)pHVar5 = 0;
}
}
iVar10 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar8 = ThreadGetCurrentId(), iVar10 == iVar8)) {
cVar7 = CVProfNode::ExitScope();
if (cVar7 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
bVar4 = local_40 < param_1;
pHVar5 = pHVar5 + 0x10;
local_40 = local_40 + 1;
} while (bVar4);
}
if (param_3) {
local_34 = 0;
local_30 = 0;
if (___atan2f_finite == 0) {
local_20 = 0;
}
else {
(**(code **)(___atan2f_finite + 0x50))
(___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/mapentities.cpp",0x120,
&SpawnAllEntities(int,HierarchicalSpawn_t*,bool)::tm_fmt,"(%s)%s","Unaccounted",
"MapEntity_ParseAllEntities_Activate");
local_20 = ___atan2f_finite;
}
iVar10 = _DAT_0105db00;
local_28 = local_34;
local_24 = local_30;
/* try { // try from 006f063a to 006f063e has its CatchHandler @ 006f0802 */
if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
(iVar8 = ThreadGetCurrentId(), iVar10 == iVar8)) {
if ((char *)*_DAT_0105d15c != "MapEntity_ParseAllEntities_Activate") {
/* try { // try from 006f0799 to 006f07aa has its CatchHandler @ 006f0802 */
_DAT_0105d15c =
(int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc9ce6c,(char *)0x1,0xbfafa1);
}
CVProfNode::EnterScope();
DAT_0105d158 = '\0';
}
/* try { // try from 006f0661 to 006f0693 has its CatchHandler @ 006f0804 */
uVar6 = (**(code **)(*mdlcache + 0x84))(mdlcache,4,0);
local_40 = 0;
if (0 < param_1) {
do {
piVar2 = mdlcache;
piVar3 = *(int **)param_2;
if (piVar3 != (int *)0x0) {
(**(code **)(*mdlcache + 0x68))(mdlcache);
/* try { // try from 006f0699 to 006f069e has its CatchHandler @ 006f07b7 */
(**(code **)(*piVar3 + 0x94))(piVar3);
(**(code **)(*piVar2 + 0x6c))(piVar2);
}
local_40 = local_40 + 1;
param_2 = param_2 + 0x10;
} while (local_40 != param_1);
}
/* try { // try from 006f06d0 to 006f06d5 has its CatchHandler @ 006f0804 */
(**(code **)(*mdlcache + 0x84))(mdlcache,4,uVar6);
iVar10 = _DAT_0105db00;
if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
(iVar8 = ThreadGetCurrentId(), iVar10 == iVar8)) {
cVar7 = CVProfNode::ExitScope();
if (cVar7 != '\0') {
_DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
}
DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
}
if (local_20 != 0) {
(**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
}
}
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.