fix(NpcTeleport): 修复转生检查逻辑

- 修改了 Actor.checkActorLevel 的调用参数,将转生检查的逻辑修正
- 优化了转生检查通过后的处理流程,提高了代码的可读性和效率
- 保留了原有的套装检查和场景传送检测逻辑
This commit is contained in:
aixianling
2024-12-19 15:49:24 +08:00
parent 21e99ac75a
commit e14c290ea8

View File

@@ -122,25 +122,27 @@ if NetmsgDispatcher then
return
end
-- 检查转生
local zs = config.zsLevel and Actor.checkActorLevel(actor,config.zsLevel, 0)
-- 检查转生
local zs = config.zsLevel and Actor.checkActorLevel(actor, 0, config.zsLevel)
--local tips = string.format(Lang.TisMsg.xxx, config.nLevel)
--Actor.sendTipmsg(actor, "等级不足!", ttFlyTip)
if editionConf.suit == System.getServerId() and config.suit then
if zs == true then
--转生符合检查则不用进行下面的检查
elseif editionConf.suit == System.getServerId() and config.suit then
-- 检查套装
local suit = SuitConfig[config.suit]
if suit and suit.equip then
local myJob = Actor.getIntProperty(actor, PROP_ACTOR_VOCATION)
for _, v in pairs(suit.equip or {}) do -- 遍历套装配置
if (not v.job or v.job and v.job == myJob) and false == Actor.hasEquiment(actor, v.id) then
--Actor.sendTipmsg(actor, "未穿戴套装["..v.name.."]", tstUI)
return
end
end
end
else
if zs ~= true then return end
end
local myJob = Actor.getIntProperty(actor, PROP_ACTOR_VOCATION)
for _, v in pairs(suit.equip or {}) do -- 遍历套装配置
if (not v.job or v.job and v.job == myJob) and false == Actor.hasEquiment(actor, v.id) then
--Actor.sendTipmsg(actor, "未穿戴套装["..v.name.."]", tstUI)
return
end
end
end
else
if zs ~= true then return end
end
-- 场景传送检测
if not Actor.canTelport(actor, config.nSceneId) then