mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-24 10:40:46 +00:00
Fix some crashes with weapon sounds inappropriately set to -1 in the cons
git-svn-id: https://svn.eduke32.com/eduke32@1690 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
ca382a894a
commit
a2d2f0ed75
1 changed files with 6 additions and 5 deletions
|
@ -2135,7 +2135,7 @@ void P_FireWeapon(DukePlayer_t *p)
|
||||||
if (aplWeaponWorksLike[p->curr_weapon][snum] != KNEE_WEAPON)
|
if (aplWeaponWorksLike[p->curr_weapon][snum] != KNEE_WEAPON)
|
||||||
p->ammo_amount[p->curr_weapon]--;
|
p->ammo_amount[p->curr_weapon]--;
|
||||||
|
|
||||||
if (aplWeaponFireSound[p->curr_weapon][snum])
|
if (aplWeaponFireSound[p->curr_weapon][snum] > 0)
|
||||||
A_PlaySound(aplWeaponFireSound[p->curr_weapon][snum],p->i);
|
A_PlaySound(aplWeaponFireSound[p->curr_weapon][snum],p->i);
|
||||||
|
|
||||||
Gv_SetVar(g_iWeaponVarID,p->curr_weapon,p->i,snum);
|
Gv_SetVar(g_iWeaponVarID,p->curr_weapon,p->i,snum);
|
||||||
|
@ -3496,9 +3496,10 @@ void P_AddWeaponNoSwitch(DukePlayer_t *p, int32_t weapon)
|
||||||
p->gotweapon |= (1<<GROW_WEAPON);
|
p->gotweapon |= (1<<GROW_WEAPON);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (aplWeaponSelectSound[p->curr_weapon][snum])
|
if (aplWeaponSelectSound[p->curr_weapon][snum] > 0)
|
||||||
S_StopEnvSound(aplWeaponSelectSound[p->curr_weapon][snum],p->i);
|
S_StopEnvSound(aplWeaponSelectSound[p->curr_weapon][snum],p->i);
|
||||||
if (aplWeaponSelectSound[weapon][snum])
|
|
||||||
|
if (aplWeaponSelectSound[weapon][snum] > 0)
|
||||||
A_PlaySound(aplWeaponSelectSound[weapon][snum],p->i);
|
A_PlaySound(aplWeaponSelectSound[weapon][snum],p->i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4313,7 +4314,7 @@ void P_ProcessWeapon(int32_t snum)
|
||||||
{
|
{
|
||||||
if ((*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1))
|
if ((*kb) == (aplWeaponTotalTime[p->curr_weapon][snum]+1))
|
||||||
{
|
{
|
||||||
if (aplWeaponReloadSound1[p->curr_weapon][snum])
|
if (aplWeaponReloadSound1[p->curr_weapon][snum] > 0)
|
||||||
A_PlaySound(aplWeaponReloadSound1[p->curr_weapon][snum],p->i);
|
A_PlaySound(aplWeaponReloadSound1[p->curr_weapon][snum],p->i);
|
||||||
}
|
}
|
||||||
else if (((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) &&
|
else if (((*kb) == (aplWeaponReload[p->curr_weapon][snum] - (i/3)) &&
|
||||||
|
@ -4322,7 +4323,7 @@ void P_ProcessWeapon(int32_t snum)
|
||||||
((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) &&
|
((*kb) == (aplWeaponReload[p->curr_weapon][snum] - i+4) &&
|
||||||
(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_RELOAD_TIMING)))
|
(aplWeaponFlags[p->curr_weapon][snum] & WEAPON_RELOAD_TIMING)))
|
||||||
{
|
{
|
||||||
if (aplWeaponReloadSound2[p->curr_weapon][snum])
|
if (aplWeaponReloadSound2[p->curr_weapon][snum] > 0)
|
||||||
A_PlaySound(aplWeaponReloadSound2[p->curr_weapon][snum],p->i);
|
A_PlaySound(aplWeaponReloadSound2[p->curr_weapon][snum],p->i);
|
||||||
}
|
}
|
||||||
else if ((*kb) >= (aplWeaponReload[p->curr_weapon][snum]))
|
else if ((*kb) >= (aplWeaponReload[p->curr_weapon][snum]))
|
||||||
|
|
Loading…
Reference in a new issue