From 1b0b1eaaf892ea070a5400483c5d0dd49e8118d4 Mon Sep 17 00:00:00 2001 From: ccubed Date: Mon, 25 Mar 2024 00:03:17 -0400 Subject: [PATCH] Minor Fixes to the mapper Minor fixes to the mapper and a small workaround for non visible rooms --- src/scripts/mapper/mapper.lua | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/src/scripts/mapper/mapper.lua b/src/scripts/mapper/mapper.lua index 57283bf..b8d8755 100644 --- a/src/scripts/mapper/mapper.lua +++ b/src/scripts/mapper/mapper.lua @@ -227,6 +227,7 @@ function lotj.mapper.startMapping(areaName) end lotj.mapper.mappingArea = areaName + lotj.mapper.lastMoveDirs = {} lotj.mapper.processCurrentRoom() end @@ -399,6 +400,26 @@ function lotj.mapper.processCurrentRoom() lastRoom = lotj.mapper.getRoomByVnum(lotj.mapper.last.vnum) 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 if room == nil then lotj.mapper.log("Added new room: "..lotj.mapper.current.name.."")