From 855a29a8fea0b0d6151b775cd3f0c3d5dac0590b Mon Sep 17 00:00:00 2001 From: ZXXX1999 <1511137684@qq.com> Date: Wed, 31 Dec 2025 14:44:12 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E8=BF=BD=E5=BF=86?= =?UTF-8?q?=E4=B8=BB=E5=9F=8E=E5=9C=B0=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Boilerplate_!Base/src/lib/Constant.lua | 12 ++++++++++++ Boilerplate_!Base/src/lib/Game.Map.lua | 12 ++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) 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 ---判断当前地图是不是主城地图