Music::OnPZAlert
0x008ef9d0 · 677 bytes · __regparm3
_ZN5Music9OnPZAlertEifPKcf.part.253
Decompiled
undefined (4 params)
/* Music::OnPZAlert(int, float, char const*, float) [clone .part.253] */
void __regparm3 Music::OnPZAlert(int param_1,float param_2,char *param_3,float param_4)
{
undefined4 uVar1;
int iVar2;
int iVar3;
int in_GS_OFFSET;
float in_XMM0_Da;
double dVar4;
float in_XMM1_Da;
char *pcVar5;
char local_a0 [128];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
iVar2 = *(int *)(MusicDynamicPZIntervalRandMultMax._28_4_ + 0x30);
if ((0.1 <= in_XMM1_Da) || (*(float *)(param_1 + 0x1b4) <= 0.1)) goto LAB_008efa24;
if (in_XMM0_Da < *(float *)(MusicDynamicSICloseMax._28_4_ + 0x2c) ||
in_XMM0_Da == *(float *)(MusicDynamicSICloseMax._28_4_ + 0x2c)) {
iVar3 = 1;
if (0 < (int)((double)iVar2 * 1.4)) {
iVar3 = (int)((double)iVar2 * 1.4);
}
uVar1 = (**(code **)(**(int **)(param_1 + 0x378) + 0xb8))(*(int **)(param_1 + 0x378));
MusicMsg("%s Music::On%sAlertCLOSE\n",uVar1,param_3);
pcVar5 = "Event.%sAlertClose";
LAB_008efbc1:
V_snprintf(local_a0,0x80,pcVar5,param_3);
Play((Music *)param_1,local_a0,(int)param_2,-1.0,false,true);
}
else {
if (in_XMM0_Da < *(float *)(MusicDynamicSIFarMin._28_4_ + 0x2c) ||
in_XMM0_Da == *(float *)(MusicDynamicSIFarMin._28_4_ + 0x2c)) {
iVar3 = 2;
if (1 < iVar2 * 2) {
iVar3 = iVar2 * 2;
}
uVar1 = (**(code **)(**(int **)(param_1 + 0x378) + 0xb8))(*(int **)(param_1 + 0x378));
MusicMsg("%s Music::On%sAlertNEAR\n",uVar1,param_3);
pcVar5 = "Event.%sAlert";
goto LAB_008efbc1;
}
dVar4 = (double)iVar2;
iVar2 = iVar2 * 2;
iVar3 = 3;
if (2 < (int)(dVar4 * 2.5)) {
iVar3 = (int)(dVar4 * 2.5);
}
uVar1 = (**(code **)(**(int **)(param_1 + 0x378) + 0xb8))(*(int **)(param_1 + 0x378));
MusicMsg("%s Music::On%sAlertFAR\n",uVar1,param_3);
V_snprintf(local_a0,0x80,"Event.%sAlertFar",param_3);
Play((Music *)param_1,local_a0,(int)param_2,-1.0,false,true);
}
RandomInt(iVar2,iVar3);
LAB_008efa24:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
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.