From 2eab795c40d64af47f624ffccba94ec88ef591bc Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期一, 03 六月 2019 11:31:22 +0800
Subject: [PATCH] Merge branch 'master' of http://192.168.0.87:10010/r/SnxxServerCode

---
 ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
index 16b5138..da0f3a2 100644
--- a/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
+++ b/ServerPython/ZoneServerGroup/map1_8G/MapServer/MapServerData/Script/Event/EventSrc/FunctionNPCCommon.py
@@ -356,7 +356,7 @@
     diffTime = GameWorld.GetCurrentTime() - GameWorld.GetDateTimeByStr(createRoleTime, ChConfig.TYPE_Time_Format)
     pastSeconds = diffTime.days*24*60*60 + diffTime.seconds
     refreshTime = IpyGameDataPY.GetFuncCfg('MysteryShopRefresh', 4)
-    if pastSeconds % refreshTime == 0:
+    if refreshTime and pastSeconds % refreshTime == 0:
         __DoMysticalShopRefresh(curPlayer, True, tick)
     return
 
@@ -372,7 +372,10 @@
 
 def __DoMysticalShopRefresh(curPlayer, isFree, tick):
     global g_mysticalShopDict #{等级范围:[等级段,{金钱类型:库}]}
-    
+    refreshTime = IpyGameDataPY.GetFuncCfg('MysteryShopRefresh', 4)
+    if not refreshTime:
+        return
+
     lastTime = curPlayer.GetDictByKey(ChConfig.Def_PlayerKey_MysticalShopLastTime)
     if lastTime and tick - lastTime < 1000:
         #GameWorld.DebugLog('神秘商店刷新,过于频繁!')
@@ -385,6 +388,8 @@
             lvRange = ipyData.GetLVRange()
             goodsID = ipyData.GetGoodsID()
             goodsIpyData = IpyGameDataPY.GetIpyGameData('Store', goodsID)
+            if not goodsIpyData:
+                continue
             moneyType = goodsIpyData.GetMoneyType()
             weight = goodsIpyData.GetLimitValue()
             lvkey = tuple(lvRange)
@@ -395,7 +400,8 @@
                 g_mysticalShopDict[lvkey][1][moneyType] = []
             weightDict[moneyType] = weightDict.get(moneyType, 0) + weight
             g_mysticalShopDict[lvkey][1][moneyType].append([weightDict[moneyType], goodsID])
-            
+    if not g_mysticalShopDict:
+        return 
     playerLV = curPlayer.GetLV()
     curLVDan, shopDict = GameWorld.GetDictValueByRangeKey(g_mysticalShopDict, playerLV)
     if not shopDict:
@@ -725,7 +731,7 @@
 
     itemControl = ItemControler.PlayerItemControler(curPlayer)
     for itemID, itemCount, isBind in totalItemList:
-        curItemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, False)
+        curItemObj = ItemControler.GetOutPutItemObj(itemID, itemCount, False, curPlayer=curPlayer)
         if not curItemObj:
             continue
         userData = curItemObj.GetUserData()

--
Gitblit v1.8.0