MEDALDEF will now throw a fatal error if a non-existent (scoreboard) icon is specified, or if no icon is specified for any medal at all.
The medal code, as it currently is, assumes that a valid icon is defined for every medal (i.e. there's no sanity checks to confirm that the icon exists). Since the introduction of MEDALDEF
, it's possible for modders to accidentally specify an invalid icon, or none at all, which can cause the game to crash when the medal's icon needs to be drawn.
This commit ensures that Zandronum throws fatal error if a non-existent icon is used, or if a medal is missing an icon, when all MEDALDEF
lumps are parsed. Scoreboard icons are still optional and don't need to be specified.
Ideally, the aforementioned sanity checks should be added anyways, as there's no harm in double-checking if the icon exists. Though, I might address this in a separate MR that'll be for refactoring the old medal code.