mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-21 08:21:31 +00:00
- added missing range checks to PlaySpriteSound.
This can be called with attr_none!
This commit is contained in:
parent
428425b6dc
commit
1e2b5c2747
2 changed files with 3 additions and 2 deletions
|
@ -62,7 +62,8 @@ enum ActorStates { SLOW_SPEED, NORM_SPEED, MID_SPEED, FAST_SPEED, MAX_SPEED};
|
|||
|
||||
enum ATTRIB_SNDS
|
||||
{
|
||||
attr_ambient = 1, attr_alert, attr_attack, attr_pain, attr_die,
|
||||
attr_none = 0,
|
||||
attr_ambient, attr_alert, attr_attack, attr_pain, attr_die,
|
||||
attr_extra1, attr_extra2, attr_extra3,attr_extra4,attr_extra5,
|
||||
attr_extra6, MAXATTRIBSNDS
|
||||
};
|
||||
|
|
|
@ -718,7 +718,7 @@ void Terminate3DSounds(void)
|
|||
|
||||
void PlaySpriteSound(DSWActor* actor, int attrib_ndx, int flags)
|
||||
{
|
||||
if (actor->hasU())
|
||||
if (actor->hasU() && attrib_ndx > attr_none && attrib_ndx < MAXATTRIBSNDS)
|
||||
PlaySound(actor->user.__legacyState.Attrib->Sounds[attrib_ndx - 1], actor, flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue