Minor Fixes to the mapper

Minor fixes to the mapper and a small workaround for non visible rooms
This commit is contained in:
Charles Click 2024-03-25 00:03:17 -04:00
parent 47bc988b39
commit 1b0b1eaaf8
Signed by: roryejinn
GPG Key ID: EDECB89DEDB998C0

View File

@ -227,6 +227,7 @@ function lotj.mapper.startMapping(areaName)
end end
lotj.mapper.mappingArea = areaName lotj.mapper.mappingArea = areaName
lotj.mapper.lastMoveDirs = {}
lotj.mapper.processCurrentRoom() lotj.mapper.processCurrentRoom()
end end
@ -399,6 +400,26 @@ function lotj.mapper.processCurrentRoom()
lastRoom = lotj.mapper.getRoomByVnum(lotj.mapper.last.vnum) lastRoom = lotj.mapper.getRoomByVnum(lotj.mapper.last.vnum)
end end
-- Try to account for moving between visible and non-visible rooms
if moveDir ~= nil then
if not table.contains(gmcp.Room.Info.exits, revDirObj(moveDir.long).long) then
-- There was no return exit in this room matching the movement
if not table.is_empty(lotj.mapper.lastMoveDirs) then
-- There are additional movements in the table so test those
while not table.is_empty(lotj.mapper.lastMoveDirs) do
local tempDir = lotj.mapper.popMoveDir()
if table.contains(gmcp.Room.Info.exits, revDirObj(tempDir.long).long) then
-- This seems to be a match so use this one and empty out the last room as it is incorrect
moveDir = tempDir
lotj.mapper.last = nil
lastRoom = nil
end
end
end
end
end
-- Create the room if we don't have it yet -- Create the room if we don't have it yet
if room == nil then if room == nil then
lotj.mapper.log("Added new room: <yellow>"..lotj.mapper.current.name.."<reset>") lotj.mapper.log("Added new room: <yellow>"..lotj.mapper.current.name.."<reset>")