Repository navigation
Commit 657b64c
committed
Fix: lit magic lamps were extinguished by water on dry land.
A magic lamp's flame is meant to be impervious to water and
engulfing, but snuff_lit() granted the exemption by location -
is_damp_terrain() at the lamp's spot, or the hero being swallowed -
rather than by cause. Any water event on dry land therefore snuffed
the lamp: the water-bucket door trap (player-reported, hero and
monster carriers), a rust trap's gush hitting a wielded lamp, water
blasts wetting weapons, and a lamp dropped or thrown into water (in
transit the object is OBJ_FREE, so get_obj_location() reports (0,0),
which reads as dry land). The heuristic also leaked the other way:
stowing a lit magic lamp into a container while swallowed left it
burning inside the container, and magical darkness could not douse a
magic lamp while the hero stood on damp terrain.
Replace the heuristic with a caller-supplied cause flag: snuff_lit()
gains a forced parameter, and a lit magic lamp only goes out when it
is TRUE. Water and engulf callers pass FALSE, so an engulfed
monster's magic lamp now also stays lit, matching the hero's.
* include/extern.h: add the boolean parameter to the prototype.
* src/apply.c: snuff_lit() checks forced instead of terrain/uswallow.
* src/trap.c: water_damage() and both rust-trap gush loops pass
FALSE; drop the loops' magic-lamp exclusions, now redundant since
the call is a silent no-op for magic lamps.
* src/pickup.c: container insertion passes TRUE (put-in must always
snuff).
* src/read.c: darkness passes TRUE (magic douses regardless of
terrain).
* src/mhitu.c, src/mhitm.c, src/uhitm.c: engulf sites pass FALSE.1 parent 7a6acfc commit 657b64c
9 files changed
Lines changed: 27 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5558 | 5558 | | |
5559 | 5559 | | |
5560 | 5560 | | |
| 5561 | + | |
5561 | 5562 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
| 51 | + | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1477 | 1477 | | |
1478 | 1478 | | |
1479 | 1479 | | |
1480 | | - | |
| 1480 | + | |
| 1481 | + | |
| 1482 | + | |
| 1483 | + | |
1481 | 1484 | | |
1482 | | - | |
| 1485 | + | |
1483 | 1486 | | |
| 1487 | + | |
1484 | 1488 | | |
1485 | 1489 | | |
1486 | 1490 | | |
1487 | 1491 | | |
1488 | 1492 | | |
1489 | 1493 | | |
1490 | | - | |
1491 | | - | |
1492 | | - | |
1493 | | - | |
| 1494 | + | |
1494 | 1495 | | |
1495 | | - | |
1496 | | - | |
1497 | | - | |
1498 | | - | |
1499 | | - | |
1500 | | - | |
1501 | | - | |
1502 | | - | |
1503 | | - | |
| 1496 | + | |
| 1497 | + | |
| 1498 | + | |
| 1499 | + | |
| 1500 | + | |
| 1501 | + | |
| 1502 | + | |
1504 | 1503 | | |
1505 | 1504 | | |
1506 | 1505 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1180 | 1180 | | |
1181 | 1181 | | |
1182 | 1182 | | |
1183 | | - | |
| 1183 | + | |
1184 | 1184 | | |
1185 | 1185 | | |
1186 | 1186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3207 | 3207 | | |
3208 | 3208 | | |
3209 | 3209 | | |
3210 | | - | |
| 3210 | + | |
3211 | 3211 | | |
3212 | 3212 | | |
3213 | 3213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2664 | 2664 | | |
2665 | 2665 | | |
2666 | 2666 | | |
2667 | | - | |
| 2667 | + | |
2668 | 2668 | | |
2669 | 2669 | | |
2670 | 2670 | | |
| |||
3785 | 3785 | | |
3786 | 3786 | | |
3787 | 3787 | | |
3788 | | - | |
| 3788 | + | |
3789 | 3789 | | |
3790 | 3790 | | |
3791 | 3791 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2654 | 2654 | | |
2655 | 2655 | | |
2656 | 2656 | | |
2657 | | - | |
| 2657 | + | |
2658 | 2658 | | |
2659 | 2659 | | |
2660 | 2660 | | |
| |||
2708 | 2708 | | |
2709 | 2709 | | |
2710 | 2710 | | |
2711 | | - | |
| 2711 | + | |
2712 | 2712 | | |
2713 | 2713 | | |
2714 | 2714 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1451 | 1451 | | |
1452 | 1452 | | |
1453 | 1453 | | |
1454 | | - | |
1455 | 1454 | | |
1456 | | - | |
| 1455 | + | |
1457 | 1456 | | |
1458 | 1457 | | |
1459 | 1458 | | |
| |||
2883 | 2882 | | |
2884 | 2883 | | |
2885 | 2884 | | |
2886 | | - | |
| 2885 | + | |
2887 | 2886 | | |
2888 | | - | |
| 2887 | + | |
2889 | 2888 | | |
2890 | 2889 | | |
2891 | 2890 | | |
| |||
4473 | 4472 | | |
4474 | 4473 | | |
4475 | 4474 | | |
4476 | | - | |
| 4475 | + | |
4477 | 4476 | | |
4478 | 4477 | | |
4479 | 4478 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4064 | 4064 | | |
4065 | 4065 | | |
4066 | 4066 | | |
4067 | | - | |
| 4067 | + | |
4068 | 4068 | | |
4069 | 4069 | | |
4070 | 4070 | | |
| |||
0 commit comments