------------------------------------------------------------------------ r2236 | helixhorned | 2012-01-05 13:58:23 -0800 (Thu, 05 Jan 2012) | 9 lines - When saving game, clear all polymer lights before. Not doing this makes the SE ones douple, triple, ... after each save. Maphack lights are reloaded with polymer_resetlights() (though I've had them disappearing after load, I couldn't reproduce it afterwards). - in debugging builds, print a message when polymer_resetlight is called on a nonexistent one. The problem is not so much the call itself (it's guarded), but the fact that resources on the caller side may not have been freed if it thinks that those lights do in fact exist. Right now, it's not the case though. - add 'loaded map hack' messages after some other successful loadmaphack calls ------------------------------------------------------------------------ r2235 | helixhorned | 2012-01-05 12:48:37 -0800 (Thu, 05 Jan 2012) | 14 lines When loading a game, DON'T restore 'adult' TV tiles. This fixes the recent crashes. Usually, after loading a game, some wall tiles are tweaked depending on whether adult mode is enabled or not. If it's not, those wall picnums are replaced with blank or broken screens. If it is, they are restored from the wall's .extra member. Apparently though, Mapster32 leaves some .extra members floating around even after deleting a TROR nextwall link (it's used as the 'lower wall index'). Because MAXWALLS is greater than MAXTILES, this may produce out-of-bounds accesses and corrupt memory (besides setting wall tilenums to nonsensical values) later in the game. Other than that, the change only affects loading savegames created with adult mode OFF. Kinky TV screenies simply won't be restored then. ------------------------------------------------------------------------