- Safely handle unknown HUD message layers.

SVN r3823 (trunk)
This commit is contained in:
Randy Heit 2012-08-12 22:54:01 +00:00
parent 73552f0365
commit 4056f0191a

View file

@ -391,6 +391,12 @@ void DBaseStatusBar::AttachMessage (DHUDMessage *msg, DWORD id, int layer)
old->Destroy(); old->Destroy();
} }
// Merge unknown layers into the default layer.
if ((size_t)layer >= countof(Messages))
{
layer = HUDMSGLayer_Default;
}
prev = &Messages[layer]; prev = &Messages[layer];
// The ID serves as a priority, where lower numbers appear in front of // The ID serves as a priority, where lower numbers appear in front of