moon-chilled / slashem9

slashem
9 stars 1 forks source link

"Unknown shop type <number> -- program in disorder" using #overview #3

Closed ToxicFrog closed 4 years ago

ToxicFrog commented 4 years ago

Looks like UNIQUESHOP & HEALTHSHOP are not in shop_string() in src/dungeon.c:1965.

Making the shop types an enum rather than #defineing them would let the compiler warn on non-exhaustive switch here, too.

moon-chilled commented 4 years ago

Fixed. UNIQUESHOP is the same as CANDLESHOP, doesn't need to be handled. Probably won't make it an enum, because shop types really need to be the same as other room types, which shop_string() really doesn't care about, and I don't think there's any other place where we need exhaustive checking. *sigh*, c. In a language with real ADT, this would be trivial.