Allow fixed-destination teleport traps

Add a theme room with multiple visible teleportation traps
which will always teleport to specific locations in the same level.

Teleport trap change from xNetHack by copperwater <aosdict@gmail.com>.
This commit is contained in:
Pasi Kallinen
2024-06-14 19:47:29 +03:00
parent a8099edca6
commit 951401e52a
6 changed files with 76 additions and 3 deletions

View File

@@ -4362,7 +4362,19 @@ lspo_trap(lua_State *L)
lua_pop(L, 1);
gl.launchplace.x = lx;
gl.launchplace.y = ly;
}
} else
lua_pop(L, 1);
lua_getfield(L, -1, "teledest");
if (lua_type(L, -1) == LUA_TTABLE) {
lua_Integer lx = -1, ly = -1;
(void) get_coord(L, -1, &lx, &ly);
lua_pop(L, 1);
gl.launchplace.x = lx;
gl.launchplace.y = ly;
} else
lua_pop(L, 1);
}
if (tmptrap.type == NO_TRAP)