error handling, path now looks in disabled ways too

This commit is contained in:
p.kosyh 2010-07-02 06:40:21 +00:00
parent 9dbb68ea74
commit e5a30e29bf
2 changed files with 11 additions and 5 deletions

View file

@ -173,13 +173,13 @@ function list_concat(self, other, pos)
end
end
function path(w, wh)
function path(w, wh) -- search in way, disabled too
if not wh then
wh = here();
else
wh = ref(wh);
end
local o = ways(wh):srch(w);
local o = ways(wh):srch(w, true);
o = ref(o);
if isRoom(o) then
return o

View file

@ -420,6 +420,12 @@ end
function obj(v)
if v.nam == nil then
if isRoom(v) then
if isDialog(v) then
error ("No dialog name in constructor.", 3);
end
error ("No room name in constructor.", 3);
end
error ("No object name in constructor.", 2);
end
v.object_type = true;
@ -772,9 +778,9 @@ function room_save(self, name, h, need)
end
function room(v) --constructor
if v.nam == nil then
error ("No room name in constructor.", 2);
end
-- if v.nam == nil then
-- error ("No room name in constructor.", 2);
-- end
if v.scene == nil then
v.scene = room_scene;
end