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:
14
src/sp_lev.c
14
src/sp_lev.c
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user