If you died while Punished but with attached ball and chain temporarily off the map (changing levels and when swallowed are the cases I looked at; there may be others), the ball and chain objects would not appear in bones (for the falling-down-stairs case; bones are never saved if hero dies while swallowed) and they weren't being freed. Put them back on the map so that they'll be included in bones and also freed as part of normal map cleanup. This caused a problem if the attached ball had state OBJ_FREE due to being thrown rather than being temporarily off the map. 'thrownobj' was being deallocated without first cancelling punishment, so uball object was freed via thrownobj pointer but stale uball pointer still referenced it. Unpunishing would introduce sequencing issues because that would need to be after attribute disclosure. So instead of deallocating thrown or kicked object, put it/them (can't actually have both at the same time) back on the map. This has a side-effect of saving thrown Mjollnir in bones if it kills hero when failing to be caught upon return. (I thought that that had been fixed ages ago?)
4.1 KiB
4.1 KiB