Skip to content

Commit 7f1721f

Browse files
committed
Allow wizmode illegal teleports only outside of the debug fuzzer
I have had two fuzzer crashes that ended up tracing back to the fuzzer teleporting directly onto a monster: 1. a vision blocking mismatch when the hero teleported and displaced a mimic imitating a boulder 2. a "you over monster" sanity check failure when the hero teleported onto the same space as a monster in water, drowned (multiple times), and the level was full of monsters so there was nowhere to relocate them to Since both of these derive from behavior that is only allowed in wizard mode (and not allowed at all upstream) anyway, address this narrowly by simply removing the debug fuzzer's ability to teleport to a specified destination and actually arrive there no matter what would make it illegal in normal play. It is still possible to do this (and expose these impossibles) in normal wizard mode.
1 parent 8280fe4 commit 7f1721f

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/teleport.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,10 @@ scrolltele(struct obj *scroll)
918918
/* possible extensions: introduce a small error if
919919
magic power is low; allow transfer to solid rock */
920920
if (teleok(cc.x, cc.y, FALSE)
921-
|| (wizard
921+
/* only allow illegal teleport overriding outside the debug fuzzer
922+
* since teleporting directly onto a monster exposes a number of
923+
* bugs that are impossible in the absence of teleport overriding */
924+
|| (wizard && !iflags.debug_fuzzer
922925
&& y_n("You can't normally teleport here. Do it anyway?")
923926
== 'y')) {
924927
/* for scroll, discover it regardless of destination */

0 commit comments

Comments
 (0)