249435196@qq.com 1 год назад
Родитель
Сommit
eb33d7586a
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      script/module/skin/SkinLogic.lua

+ 3 - 2
script/module/skin/SkinLogic.lua

@@ -160,12 +160,13 @@ local function skinOff(human,heroIdx)
     end
     local skinIdx = nil
     for idx,skin in pairs(human.db.skinBag) do 
-        if skin.id == skinId then
+        if idx > 0 and skin.id == skinId then
             skinIdx = idx
             human.db.skinBag[idx].state = 0
             break 
         end
     end
+    assert(skinIdx,"param error")
 	-- 对所有heroId相同的英雄操作
 	local heroIdxList = HeroLogic.getHeroListById(human,heroId)
 	for _,idx in ipairs(heroIdxList) do
@@ -317,7 +318,7 @@ function skinOp(human,heroIdx,skinIdx)
     local retMsg = Msg.gc.GC_SKIN_ON
     retMsg.heroId = heroIdx
     retMsg.skinInd = skinIdx
-    Msg.send(msgRet,human.fd)
+    Msg.send(retMsg,human.fd)
 end
 
 -- 皮肤解锁