mirror of
https://github.com/ChocoTaco1/TacoServer.git
synced 2026-07-15 16:14:35 +00:00
Hitsound overflow fix
This commit is contained in:
parent
162216944f
commit
5dc7c0c8c7
1 changed files with 27 additions and 6 deletions
|
|
@ -3318,13 +3318,34 @@ function serverCmdProcessGameLink(%client, %arg1, %arg2, %arg3, %arg4, %arg5)
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------
|
||||||
// z0dd - ZOD, 6/03/02. New function. Impact hit sounds settings from clientprefs.cs.
|
// z0dd - ZOD, 6/03/02. New function. Impact hit sounds settings from clientprefs.cs.
|
||||||
function serverCmdSetHitSounds( %client, %playerHitsOn, %playerHitWav, %vehicleHitsOn, %vehicleHitWav )
|
// function serverCmdSetHitSounds( %client, %playerHitsOn, %playerHitWav, %vehicleHitsOn, %vehicleHitWav )
|
||||||
{
|
// {
|
||||||
%client.playerHitSound = %playerHitsOn;
|
// %client.playerHitSound = %playerHitsOn;
|
||||||
%client.playerHitWav = addtaggedString(%playerHitWav);
|
// %client.playerHitWav = addtaggedString(%playerHitWav);
|
||||||
|
|
||||||
%client.vehicleHitSound = %vehicleHitsOn;
|
// %client.vehicleHitSound = %vehicleHitsOn;
|
||||||
%client.vehicleHitWav = addtaggedString(%vehicleHitWav);
|
// %client.vehicleHitWav = addtaggedString(%vehicleHitWav);
|
||||||
|
// }
|
||||||
|
//Rewritten to prevent overflows
|
||||||
|
function serverCmdSetHitSounds( %client, %playerHitsOn, %playerHitWav, %vehicleHitsOn, %vehicleHitWav ){
|
||||||
|
if(%client.hitTagSoundCount < 15){// limit this to prevent string table overflow
|
||||||
|
|
||||||
|
%client.playerHitSound = %playerHitsOn;
|
||||||
|
%client.playerHitWav = addtaggedString(%playerHitWav);
|
||||||
|
|
||||||
|
if(!%client.hitTagSound[%client.playerHitWav]){
|
||||||
|
%client.hitTagSound[%client.playerHitWav] = 1;
|
||||||
|
%client.hitTagSoundCount++;
|
||||||
|
}
|
||||||
|
|
||||||
|
%client.vehicleHitSound = %vehicleHitsOn;
|
||||||
|
%client.vehicleHitWav = addtaggedString(%vehicleHitWav);
|
||||||
|
|
||||||
|
if(!%client.hitTagSound[%client.vehicleHitWav]){
|
||||||
|
%client.hitTagSound[%client.vehicleHitWav] = 1;
|
||||||
|
%client.hitTagSoundCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------------
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue