Skip to content

Commit

Permalink
Fix: swap chest vs cancellation
Browse files Browse the repository at this point in the history
Don't reset the swap chest when it's hit by cancellation. Because
obj->swapitems is just an alias for obj->spe, having cancellation work
normally was enabling players to put in/take out items, then zap
cancellation to reset the swap chest's state and repeat.
  • Loading branch information
entrez committed Nov 23, 2022
1 parent e40fdd7 commit 103338c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/zap.c
Expand Up @@ -1081,7 +1081,8 @@ register struct obj *obj;
if (obj->spe != ((obj->oclass == WAND_CLASS) ? -1 : 0)
&& otyp != WAN_CANCELLATION /* can't cancel cancellation */
&& otyp != MAGIC_LAMP /* cancelling doesn't remove djinni */
&& otyp != CANDELABRUM_OF_INVOCATION) {
&& otyp != CANDELABRUM_OF_INVOCATION
&& otyp != SWAP_CHEST) {
costly_alteration(obj, COST_CANCEL);
obj->spe = (obj->oclass == WAND_CLASS) ? -1 : 0;
}
Expand Down

0 comments on commit 103338c

Please sign in to comment.