diff --git a/Boilerplate_!Base/src/lib/Constant.lua b/Boilerplate_!Base/src/lib/Constant.lua index 6f526cb..6658b4d 100644 --- a/Boilerplate_!Base/src/lib/Constant.lua +++ b/Boilerplate_!Base/src/lib/Constant.lua @@ -535,6 +535,18 @@ local CONSTANT = { ROGUELIKE_MAP = { [995] = true, -- 八荒衡鉴 }, + CITY_MAP = { + [ 6] = true, -- 扬州 + [ 8] = true, -- 洛阳 + [ 15] = true, -- 长安 + [108] = true, -- 成都 + [151] = true, -- 洛阳·战乱 + [156] = true, -- 长安·战乱 + [172] = true, -- 长安城 + [194] = true, -- 太原 + [239] = true, -- 洛阳城 + [332] = true, -- 侠客岛 + }, STRONGHOLD_MAP = { [ 9] = true, -- 洛道 [ 13] = true, -- 金水镇 diff --git a/Boilerplate_!Base/src/lib/Game.Map.lua b/Boilerplate_!Base/src/lib/Game.Map.lua index f568b26..81c1b4e 100644 --- a/Boilerplate_!Base/src/lib/Game.Map.lua +++ b/Boilerplate_!Base/src/lib/Game.Map.lua @@ -186,9 +186,17 @@ end ---判断一个地图是不是主城地图 ---@param dwMapID number @要判断的地图ID ---@return boolean @是否是主城地图 +do +local CITY_MAP = X.CONSTANT.CITY_MAP or {} function X.IsCityMap(dwMapID) - local tType = Table_GetMapType(dwMapID) - return tType and tType.CITY and true or false + if CITY_MAP[dwMapID] ~= nil then + return CITY_MAP[dwMapID] + else + local tType = Table_GetMapType(dwMapID) + CITY_MAP[dwMapID] = tType and tType.CITY and true or false + return CITY_MAP[dwMapID] + end +end end ---判断当前地图是不是主城地图