fix(NpcTeleport): 修复转生检查逻辑
- 修改了 Actor.checkActorLevel 的调用参数,将转生检查的逻辑修正 - 优化了转生检查通过后的处理流程,提高了代码的可读性和效率 - 保留了原有的套装检查和场景传送检测逻辑
This commit is contained in:
		| @@ -122,25 +122,27 @@ if NetmsgDispatcher then | |||||||
| 				return | 				return | ||||||
| 			end | 			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) | 			--local tips = string.format(Lang.TisMsg.xxx, config.nLevel) | ||||||
| 			--Actor.sendTipmsg(actor, "等级不足!", ttFlyTip) | 			--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] | 				local suit = SuitConfig[config.suit] | ||||||
| 				if suit and suit.equip then | 				if suit and suit.equip then | ||||||
| 				    local myJob = Actor.getIntProperty(actor, PROP_ACTOR_VOCATION) | 					local myJob = Actor.getIntProperty(actor, PROP_ACTOR_VOCATION) | ||||||
|     				for _, v in pairs(suit.equip or {}) do -- 遍历套装配置 | 					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 | 						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) | 								--Actor.sendTipmsg(actor, "未穿戴套装["..v.name.."]", tstUI) | ||||||
|         				    return | 								return | ||||||
|         				end | 						end | ||||||
|         			end | 					end | ||||||
|         		end | 				end | ||||||
|     		else | 			else | ||||||
|     		    if zs ~= true then return end | 					if zs ~= true then return end | ||||||
|     		end | 			end | ||||||
|  |  | ||||||
| 			-- 场景传送检测 | 			-- 场景传送检测 | ||||||
| 			if not Actor.canTelport(actor, config.nSceneId) then | 			if not Actor.canTelport(actor, config.nSceneId) then | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user