CBaseServerVehicle::SoundState_ChooseState
0x00b3a910 · 757 bytes · __thiscall
_ZN18CBaseServerVehicle22SoundState_ChooseStateER18vbs_sound_update_t
Decompiled
undefined (2 params)
/* CBaseServerVehicle::SoundState_ChooseState(vbs_sound_update_t&) */
uint __thiscall
CBaseServerVehicle::SoundState_ChooseState(CBaseServerVehicle *this,vbs_sound_update_t *param_1)
{
bool bVar1;
char cVar2;
uint uVar3;
uint uVar4;
int iVar5;
CBaseServerVehicle *in_stack_ffffffd4;
vbs_sound_update_t *in_stack_ffffffd8;
uVar3 = *(uint *)(this + 0x194);
if (param_1[0x10] != (vbs_sound_update_t)0x0) {
if (uVar3 < 3) {
return uVar3;
}
return 1;
}
bVar1 = *(float *)(this + uVar3 * 4 + 0x130) <
*(float *)(gpGlobals + 0xc) - *(float *)(this + 0x198);
uVar4 = uVar3;
switch(uVar3) {
case 0:
case 1:
case 4:
break;
case 2:
case 3:
if (param_1[0xf] == (vbs_sound_update_t)0x0) {
return 4;
}
break;
case 5:
if (param_1[0xf] != (vbs_sound_update_t)0x0) {
return 2;
}
goto switchD_00b3aa1d_caseD_5;
case 6:
case 7:
case 8:
case 9:
case 10:
case 0xb:
case 0xc:
case 0xd:
case 0xe:
case 0xf:
case 0x10:
case 0x11:
case 0x13:
if (param_1[0xf] != (vbs_sound_update_t)0x0) {
return 2;
}
if (param_1[0xe] != (vbs_sound_update_t)0x0) {
return 0x12;
}
goto LAB_00b3a9ef;
case 0x12:
if (param_1[0xf] != (vbs_sound_update_t)0x0) {
return 2;
}
LAB_00b3a9ef:
cVar2 = CheckCrash(in_stack_ffffffd4,in_stack_ffffffd8);
if (cVar2 == '\0') {
uVar4 = *(uint *)(this + 0x194);
break;
}
goto LAB_00b3aa02;
default:
goto switchD_00b3a975_default;
}
switch(uVar4) {
case 0:
uVar3 = ~-(uint)(param_1[0xf] == (vbs_sound_update_t)0x0) + 4;
break;
case 4:
if ((bVar1) || (param_1[0xc] != (vbs_sound_update_t)0x0)) goto LAB_00b3aa02;
default:
switchD_00b3a975_default:
break;
case 5:
switchD_00b3aa1d_caseD_5:
if (!bVar1) {
return uVar3;
}
if (param_1[0xc] == (vbs_sound_update_t)0x0) {
return uVar3;
}
if (param_1[0xe] != (vbs_sound_update_t)0x0) {
return 0x12;
}
goto LAB_00b3a9bd;
case 6:
case 0xd:
if (((!bVar1) || (param_1[0xc] != (vbs_sound_update_t)0x0)) &&
(param_1[0xd] == (vbs_sound_update_t)0x0)) {
if (*(int *)(this + 0x184) < 1) {
return uVar3;
}
return 7;
}
LAB_00b3aa02:
uVar3 = 5;
break;
case 7:
case 0xe:
if ((bVar1) && (param_1[0xc] == (vbs_sound_update_t)0x0)) {
return 0xb;
}
iVar5 = *(int *)(this + 0x184);
if (iVar5 == 1) {
return uVar3;
}
if (iVar5 == 2) {
return 8;
}
goto LAB_00b3ab18;
case 8:
case 0xf:
if (!bVar1) {
return uVar3;
}
if (param_1[0xc] == (vbs_sound_update_t)0x0) {
return 0xb;
}
iVar5 = *(int *)(this + 0x184);
if (iVar5 == 2) {
return uVar3;
}
if (iVar5 == 1) {
return 7;
}
LAB_00b3ab18:
uVar3 = 9;
if (iVar5 != 3) {
LAB_00b3ab23:
uVar3 = 10;
if (iVar5 == 0) {
LAB_00b3a9bd:
uVar3 = 6;
if (param_1[0xd] != (vbs_sound_update_t)0x0) {
LAB_00b3a9c8:
uVar3 = 0x13;
}
}
}
break;
case 9:
case 0x10:
if (!bVar1) {
return uVar3;
}
if (param_1[0xc] == (vbs_sound_update_t)0x0) {
return 0xb;
}
iVar5 = *(int *)(this + 0x184);
if (iVar5 == 3) {
return uVar3;
}
if (iVar5 == 1) {
return 7;
}
if (iVar5 == 2) {
return 8;
}
goto LAB_00b3ab23;
case 10:
case 0x11:
if ((bVar1) && (param_1[0xc] == (vbs_sound_update_t)0x0)) {
return 0xb;
}
iVar5 = *(int *)(this + 0x184);
if (iVar5 == 4) {
return uVar3;
}
goto LAB_00b3aa8a;
case 0xb:
case 0xc:
if (param_1[0xc] == (vbs_sound_update_t)0x0) {
if (*(int *)(this + 0x184) != 0) {
return uVar3;
}
return 5;
}
goto LAB_00b3aa84;
case 0x12:
if (!bVar1) {
return uVar3;
}
if (param_1[0xe] != (vbs_sound_update_t)0x0) {
return uVar3;
}
LAB_00b3aa84:
iVar5 = *(int *)(this + 0x184);
LAB_00b3aa8a:
if (iVar5 == 1) {
return 0xe;
}
if (1 < iVar5) {
if (iVar5 == 2) {
return 0xf;
}
if (iVar5 != 3) {
return 0x11;
}
return 0x10;
}
if (iVar5 != 0) {
return 0x11;
}
if (param_1[0xd] == (vbs_sound_update_t)0x0) {
return 0xd;
}
goto LAB_00b3a9c8;
case 0x13:
if ((bVar1) && (param_1[0xd] == (vbs_sound_update_t)0x0)) {
uVar3 = 0xb;
}
}
return uVar3;
}
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.