Skip to content

Commit b43e669

Browse files
committed
Fixed problem with rooms drawn over each other
1 parent 24ae3c8 commit b43e669

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lua/mapper.lua

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
55
Author: Nick Gammon
66
Date: 11th March 2010
7+
Amended: 3rd May 2010
78
89
Generic MUD mapper.
910
@@ -59,7 +60,7 @@ Room info should include:
5960

6061
module (..., package.seeall)
6162

62-
VERSION = 1.7 -- for querying by plugins
63+
VERSION = 1.8 -- for querying by plugins
6364

6465
require "movewindow"
6566
require "copytable"
@@ -596,7 +597,7 @@ local function draw_room (uid, path, x, y)
596597
local coords = string.format ("%i,%i", math.floor (x), math.floor (y))
597598

598599
-- need this for the *current* room !!!
599-
drawn_coords [coords] = true
600+
drawn_coords [coords] = uid
600601

601602
-- print ("drawing", uid, "at", coords)
602603

@@ -690,8 +691,7 @@ local function draw_room (uid, path, x, y)
690691
end -- if
691692

692693
-- if another room (not where this one leads to) is already there, only draw "stub" lines
693-
if drawn_coords [next_coords] and
694-
(drawn [exit_uid] and drawn [exit_uid].coords ~= next_coords) then
694+
if drawn_coords [next_coords] and drawn_coords [next_coords] ~= exit_uid then
695695
exit_info = stub_exit_info
696696
elseif exit_uid == uid then
697697

@@ -714,7 +714,7 @@ local function draw_room (uid, path, x, y)
714714
local new_path = copytable.deep (path)
715715
table.insert (new_path, { dir = dir, uid = exit_uid })
716716
table.insert (rooms_to_be_drawn, add_another_room (exit_uid, new_path, next_x, next_y))
717-
drawn_coords [next_coords] = true
717+
drawn_coords [next_coords] = exit_uid
718718
plan_to_draw [exit_uid] = next_coords
719719

720720
-- if exit room known

0 commit comments

Comments
 (0)