You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When doing damage to a shop tile the second time, before the first damage to the same tile is repaired, you will not anger the shopkeeper or be prompted to pay. The only realistic scenario (that I can think of) of this happening is breaking down the door and then digging a pit in the doorway. Normally you would be charged 200 zm for ruining the doorway, but after paying 400 zm for breaking the door the shopkeeper ignores the pit. Restoring the broken door with wizard lock and then breaking it down again will also not trigger a second payment, but it sort of makes sense.
Why this is happening: when add_damage() registers new damage, it checks for existing damage at the same square, and upon finding some merely updates its cost:
And the updated record still has its old when field which is likely stale by now. (In fact, it may even be behind other stale records, in which case the loop won't even get to check it.) And so it is ignored.
I suppose the accumulation of cost makes sense for two damage events occuring on the same move (right?), but while old records do need to be kept (they hold the original terrain type), they probably should be moved to the top of the list with updated when, or something like that.
The text was updated successfully, but these errors were encountered:
When doing damage to a shop tile the second time, before the first damage to the same tile is repaired, you will not anger the shopkeeper or be prompted to pay. The only realistic scenario (that I can think of) of this happening is breaking down the door and then digging a pit in the doorway. Normally you would be charged 200 zm for ruining the doorway, but after paying 400 zm for breaking the door the shopkeeper ignores the pit. Restoring the broken door with wizard lock and then breaking it down again will also not trigger a second payment, but it sort of makes sense.
Why this is happening: when
add_damage()
registers new damage, it checks for existing damage at the same square, and upon finding some merely updates itscost
:NetHack/src/shk.c
Line 3314 in fedc093
But at
pay_for_damage()
there's a check for stale damage records:NetHack/src/shk.c
Line 3874 in fedc093
And the updated record still has its old
when
field which is likely stale by now. (In fact, it may even be behind other stale records, in which case the loop won't even get to check it.) And so it is ignored.I suppose the accumulation of
cost
makes sense for two damage events occuring on the same move (right?), but while old records do need to be kept (they hold the original terrain type), they probably should be moved to the top of the list with updatedwhen
, or something like that.The text was updated successfully, but these errors were encountered: