Repository navigation
Commit d63c0db
committed
Fix: paying an angry shopkeeper away from his shop hit an impossible.
dopay() assumes an angry shopkeeper can never have a live bill while
the hero is not their shop's resident customer: the "after your hide /
after blood" branch only handles the robbed total, and everything
past it requires shkp == resident, else impossible("dopay: not to
shopkeeper?"). That invariant leaks. Angering a shk by attacking them
(rile_shk()/setmangry()) does not touch the bill, and u_left_shop()
returns early without rob_shop() when the shk is not inside their shop,
so a hero who steps out while the angry shk is already outside
chasing keeps billct/debit live. Pressing 'p' next to that shk then
took the irate-shk shortcut straight to the impossible (a panic under
the fuzzer's impossible-escalation mode). The hero-inside variant,
shk adjacent just beyond their door, reached it too. The same latent
assumption exists upstream in 3.6.7 and 5.0.
* src/shk.c: factor the "past due" conversion out of make_angry_shk()
into new past_due_charges() (bill, debit, and loan fold into
robbed, offset by credit, then setpaid() clears them); dopay() now
settles the books with it when a non-resident angry shk still has
billct or debit, so payment falls through to the existing "after
blood, not money" compensation branch and pacifies the shk. The
impossible remains as a safety net.1 parent a23c53e commit d63c0db
2 files changed
Lines changed: 28 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5540 | 5540 | | |
5541 | 5541 | | |
5542 | 5542 | | |
| 5543 | + | |
5543 | 5544 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
1238 | 1239 | | |
1239 | 1240 | | |
1240 | 1241 | | |
1241 | | - | |
1242 | | - | |
1243 | | - | |
1244 | | - | |
1245 | | - | |
1246 | | - | |
| 1242 | + | |
| 1243 | + | |
| 1244 | + | |
| 1245 | + | |
1247 | 1246 | | |
1248 | | - | |
1249 | | - | |
1250 | 1247 | | |
1251 | 1248 | | |
1252 | 1249 | | |
| |||
1259 | 1256 | | |
1260 | 1257 | | |
1261 | 1258 | | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
1262 | 1272 | | |
1263 | 1273 | | |
1264 | 1274 | | |
| |||
1438 | 1448 | | |
1439 | 1449 | | |
1440 | 1450 | | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
1441 | 1460 | | |
1442 | 1461 | | |
1443 | 1462 | | |
| |||
0 commit comments