CBaseServerVehicle::SoundState_OnNewState
0x00b3ad10 · 243 bytes · __cdecl
_ZN18CBaseServerVehicle21SoundState_OnNewStateE12sound_states
Decompiled
undefined (1 param)
/* CBaseServerVehicle::SoundState_OnNewState(sound_states) */
void CBaseServerVehicle::SoundState_OnNewState(CBaseServerVehicle *param_1)
{
int iVar1;
int iVar2;
int iVar3;
char *pcVar4;
CBaseServerVehicle *this;
char *pcVar5;
if (*(int *)(g_debug_vehiclesound._28_4_ + 0x30) != 0) {
iVar1 = *(int *)(param_1 + 0x194);
iVar2 = 0;
if (-1 < iVar1) {
iVar2 = iVar1;
}
iVar3 = 0x13;
if (iVar2 < 0x14) {
iVar3 = iVar2;
}
Msg("Switched to state: %d (%s)\n",iVar1,(&pSoundStateNames)[iVar3]);
}
switch(*(int *)(param_1 + 0x194)) {
default:
goto switchD_00b3ad64_caseD_0;
case 1:
case 2:
case 3:
pcVar5 = (char *)0x3e800000;
this = param_1;
StopLoopingSound(param_1,0.25);
pcVar4 = "";
if (*(char **)(param_1 + *(int *)(param_1 + 0x194) * 4 + 0xe0) != (char *)0x0) {
pcVar4 = *(char **)(param_1 + *(int *)(param_1 + 0x194) * 4 + 0xe0);
}
if (*pcVar4 != '\0') {
PlaySound(this,pcVar5);
}
goto switchD_00b3ad64_caseD_0;
case 4:
case 6:
case 7:
case 8:
case 9:
case 10:
case 0xd:
case 0xe:
case 0xf:
case 0x10:
case 0x11:
case 0x12:
case 0x13:
pcVar4 = *(char **)(param_1 + *(int *)(param_1 + 0x194) * 4 + 0xe0);
break;
case 5:
*(undefined4 *)(param_1 + 0x19c) = 0xbf800000;
pcVar4 = *(char **)(param_1 + 0xf4);
break;
case 0xb:
case 0xc:
if (*(int *)(param_1 + 0x184) < 2) {
pcVar4 = *(char **)(param_1 + 0x10c);
}
else {
pcVar4 = *(char **)(param_1 + 0x110);
}
}
pcVar5 = "";
if (pcVar4 != (char *)0x0) {
pcVar5 = pcVar4;
}
PlayLoopingSound(param_1,pcVar5);
switchD_00b3ad64_caseD_0:
*(undefined4 *)(param_1 + 0x198) = *(undefined4 *)(gpGlobals + 0xc);
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.