Fixes #121 Fix githib issue #121 - shopkeepers don't charge for consecutive acts of vandalism on the same square. pay_for_damage() keys its action on the 'when' field of the damage structure, and when a second type of damage gets added to existing damage, that wasn't being updated. Both bits of damage (broken door or dug wall plus trap created at same spot) get repaired together but shopkeeper wasn't challanging hero to pay for the second one (trap). The repair process had issues too. If you broke a shop door, paid off the shopkeeper, then left the level before the repair took place and came back after (or rather, catching up for lost time repaired it when you returned to the level), it didn't actually get fixed and remained a doorless doorway that was considered to have been successfully repaired (record of damage discarded). Unless there was also a trap there; then the door did get properly fixed when the trap was removed. Object scattering during wall repair was bypassed if trap removal took place. Also, trap removal while off level still gave messages when it took place after you returned. I didn't try to verify that; it's possible that vision is in a state where you can't see the repair even if you return to a spot where it would be visible. But the return value from the repair routine was one which wanted a message instead of the one to suppress messages. Not addressed: digging a pit inside a shop (aside from in doorway or breached wall) is not treated as damage which should be repaired. This includes the case of digging up a grave which converts the spot into ordinary floor (plus pit trap).
8.4 KiB
8.4 KiB