savebones() sets all the fruit indices negative, then resets to the normal positive value for each fruit it actually writes into the bones file. But if 'perm_invent' is enabled and something triggers an update_inventory() while bones saving is in progress, object formatting for the inventory display won't be able to find any fruits, resulting in impossible "Bad fruit #N". Fix is to turn off 'perm_invent' when the game ends, so it won't be On when bones are written. Disclosure uses a popup for inventory so persistent window is obsolete by then anyway. [I don't know what is triggering update_inventory() while savebones() is executing. Also, I don't see where the fruits whose index stayed negative--because there aren't any on level being saved--get purged. Maybe when those bones are loaded by another game?]
10 KiB
10 KiB