yet more shop sanity checking
Reconcile boulder pushing with no_charge sanity checking. The hack.c
part comes from entrez.
Pushing a for-sale boulder from inside the shop to the shop's boundary
("free spot", doorway, or gap in wall) adds it to the shop bill even
though it's still on the floor. Leaving the shop without paying for
it is a robbery. Also, pushing an unpaid boulder that's on the shop
boundary to any spot that's all the way outside the shop is robbery.
This commit is contained in:
10
src/hack.c
10
src/hack.c
@@ -243,7 +243,7 @@ moverock(void)
|
||||
|| doorless_door(rx, ry)) && !sobj_at(BOULDER, rx, ry)) {
|
||||
ttmp = t_at(rx, ry);
|
||||
mtmp = m_at(rx, ry);
|
||||
costly = (!otmp->no_charge && costly_spot(sx, sy)
|
||||
costly = (costly_spot(sx, sy)
|
||||
&& shop_keeper(*in_rooms(sx, sy, SHOPBASE)));
|
||||
|
||||
/* KMH -- Sokoban doesn't let you push boulders diagonally */
|
||||
@@ -383,7 +383,7 @@ moverock(void)
|
||||
(void) rloco(otmp);
|
||||
} else {
|
||||
if (costly)
|
||||
addtobill(otmp, FALSE, FALSE, FALSE);
|
||||
stolen_value(otmp, rx, ry, !ttmp->tseen, FALSE);
|
||||
obj_extract_self(otmp);
|
||||
add_to_migration(otmp);
|
||||
get_level(&dest, newlev);
|
||||
@@ -451,6 +451,12 @@ moverock(void)
|
||||
!= 0)
|
||||
&& onshopbill(otmp, shkp, TRUE)) {
|
||||
subfrombill(otmp, shkp);
|
||||
} else if (otmp->unpaid && !*in_rooms(rx, ry, SHOPBASE)
|
||||
&& *in_rooms(sx, sy, SHOPBASE)) {
|
||||
/* once the boulder is fully out of the shop, so that it's
|
||||
* impossible to change your mind and push it back in without
|
||||
* leaving and triggering Kops, switch it to stolen_value */
|
||||
stolen_value(otmp, sx, sy, TRUE, FALSE);
|
||||
}
|
||||
} else {
|
||||
nopushmsg:
|
||||
|
||||
Reference in New Issue
Block a user