function()
des.room({ type = "themed",
contents = function(rm)
- for x = 0, rm.width do
- for y = 0, rm.height do
+ for x = 0, rm.width - 1 do
+ for y = 0, rm.height - 1 do
if (percent(30)) then
if (percent(50)) then
des.object("boulder");
function()
des.room({ type = "themed",
contents = function(rm)
- for x = 0, rm.width do
- for y = 0, rm.height do
+ for x = 0, rm.width - 1 do
+ for y = 0, rm.height - 1 do
if (percent(30)) then
des.trap("web", x, y);
end
"land mine", "sleep gas", "rust",
"anti magic" };
shuffle(traps);
- for x = 0, rm.width do
- for y = 0, rm.height do
+ for x = 0, rm.width - 1 do
+ for y = 0, rm.height - 1 do
if (percent(30)) then
des.trap(traps[1], x, y);
end
contents = function(rm)
local terr = { "-", "-", "-", "-", "L", "P", "T" };
shuffle(terr);
- for x = 0, (rm.width - 3) / 4 do
- for y = 0, (rm.height - 3) / 4 do
+ for x = 0, (rm.width / 4) - 1 do
+ for y = 0, (rm.height / 4) - 1 do
des.terrain({ x = x * 4 + 2, y = y * 4 + 2, typ = terr[1], lit = -2 });
des.terrain({ x = x * 4 + 3, y = y * 4 + 2, typ = terr[1], lit = -2 });
des.terrain({ x = x * 4 + 2, y = y * 4 + 3, typ = terr[1], lit = -2 });
function()
des.room({ type = "themed", w = 5 + nh.rn2(3)*2, h = 5 + nh.rn2(3)*2,
contents = function(rm)
- des.room({ type = "themed", x = (rm.width / 2), y = (rm.height / 2), w = 1, h = 1, joined = 0,
+ des.room({ type = "themed",
+ x = (rm.width - 1) / 2, y = (rm.height - 1) / 2,
+ w = 1, h = 1, joined = 0,
contents = function()
if (percent(50)) then
local mons = { "M", "V", "L", "Z" };
contents = function(rm)
local feature = { "C", "L", "I", "P", "T" };
shuffle(feature);
- des.terrain(rm.width / 2, rm.height / 2, feature[1]);
+ des.terrain((rm.width - 1) / 2, (rm.height - 1) / 2,
+ feature[1]);
end
});
end,
-NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.307 $ $NHDT-Date: 1600863687 2020/09/23 12:21:27 $
+NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.308 $ $NHDT-Date: 1600909016 2020/09/24 00:56:56 $
General Fixes and Modified Features
-----------------------------------
[no actual code problem found; might be compiler bug for 'xchar']
learn scroll of teleportation after reading even when random destination is
right by starting spot
+fix off-by-one bug in dimensions of theme rooms
curses: 'msg_window' option wasn't functional for curses unless the binary
also included tty support
-/* NetHack 3.7 sp_lev.c $NHDT-Date: 1599434249 2020/09/06 23:17:29 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.202 $ */
+/* NetHack 3.7 sp_lev.c $NHDT-Date: 1600909016 2020/09/24 00:56:56 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.203 $ */
/* Copyright (c) 1989 by Jean-Christophe Collet */
/* NetHack may be freely redistributed. See license for details. */
lua_getfield(L, 1, "contents");
if (lua_type(L, -1) == LUA_TFUNCTION) {
lua_remove(L, -2);
- l_push_wid_hei_table(L, tmpcr->hx - tmpcr->lx, tmpcr->hy - tmpcr->ly);
+ l_push_wid_hei_table(L, 1 + tmpcr->hx - tmpcr->lx,
+ 1 + tmpcr->hy - tmpcr->ly);
lua_call(L, 1, 0);
} else
lua_pop(L, 1);