GPWS: avoid "altitude_callout_voice != NULL" assertion
Properly remember which active alerts were already voiced. Added NULL-pointer safety check
This commit is contained in:
parent
258a4436aa
commit
99ee9a1bbb
1 changed files with 6 additions and 3 deletions
|
@ -2319,6 +2319,8 @@ MK_VIII::VoicePlayer::get_sample (const char *name)
|
||||||
void
|
void
|
||||||
MK_VIII::VoicePlayer::play (Voice *_voice, unsigned int flags)
|
MK_VIII::VoicePlayer::play (Voice *_voice, unsigned int flags)
|
||||||
{
|
{
|
||||||
|
if (!_voice)
|
||||||
|
return;
|
||||||
if (test_bits(flags, PLAY_NOW) || ! voice || voice->element->silence)
|
if (test_bits(flags, PLAY_NOW) || ! voice || voice->element->silence)
|
||||||
{
|
{
|
||||||
if (voice)
|
if (voice)
|
||||||
|
@ -2978,9 +2980,10 @@ MK_VIII::AlertHandler::update ()
|
||||||
mk->voice_player.play(mk_voice(bank_angle_pause_bank_angle));
|
mk->voice_player.play(mk_voice(bank_angle_pause_bank_angle));
|
||||||
}
|
}
|
||||||
|
|
||||||
// set new state
|
// remember all alerts voiced so far...
|
||||||
|
old_alerts |= voice_alerts;
|
||||||
old_alerts = voice_alerts;
|
// ... forget those no longer active
|
||||||
|
old_alerts &= alerts;
|
||||||
repeated_alerts = 0;
|
repeated_alerts = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue