Music::OnMobSpawn
0x008f02e0 · 526 bytes · __thiscall
_ZN5Music10OnMobSpawnEii
Decompiled
undefined (3 params)
/* Music::OnMobSpawn(int, int) */
void __thiscall Music::OnMobSpawn(Music *this,int param_1,int param_2)
{
float fVar1;
char cVar2;
undefined4 uVar3;
int iVar4;
int in_GS_OFFSET;
longdouble lVar5;
char *pcVar6;
char local_e0 [64];
char local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
lVar5 = (longdouble)CountdownTimer::Now();
fVar1 = *(float *)(this + 0x1c0);
if ((float)lVar5 + fVar1 != *(float *)(this + 0x1c4)) {
(**(code **)(*(int *)(this + 0x1bc) + 4))(this + 0x1bc,this + 0x1c4);
*(float *)(this + 0x1c4) = (float)lVar5 + fVar1;
}
this[0x1e0] = (Music)0x1;
if (param_2 == 0) {
_V_strcpy(local_e0,"ANYWHERE");
LAB_008f0386:
uVar3 = (**(code **)(**(int **)(this + 0x378) + 0xb8))(*(int **)(this + 0x378));
MusicMsg("%s Music::OnMobSpawn %s : %i\n",uVar3,local_e0,param_1);
CDirectorTacticalServices::GetCommonInfectedCount
(*(CDirectorTacticalServices **)(TheDirector + 0x628),1);
cVar2 = CDirector::IsFinale(TheDirector);
if (cVar2 != '\0') goto LAB_008f03e0;
iVar4 = *(int *)this;
pcVar6 = "Event.MobSignal1";
}
else {
if (param_2 != 1) {
_V_strcpy(local_e0,"OTHER");
goto LAB_008f0386;
}
_V_strcpy(local_e0,"BEHIND");
uVar3 = (**(code **)(**(int **)(this + 0x378) + 0xb8))(*(int **)(this + 0x378));
MusicMsg("%s Music::OnMobSpawn %s : %i\n",uVar3,local_e0,param_1);
CDirectorTacticalServices::GetCommonInfectedCount
(*(CDirectorTacticalServices **)(TheDirector + 0x628),1);
cVar2 = CDirector::IsFinale(TheDirector);
if (cVar2 != '\0') goto LAB_008f03e0;
iVar4 = *(int *)this;
pcVar6 = "Event.MobSignal2";
}
(**(code **)(iVar4 + 0x18))(this,pcVar6,local_a0);
Play(this,local_a0,0,-1.0,false,false);
LAB_008f03e0:
if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
return;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.