Browse Source

武器刷新bug

cyzhao 3 năm trước cách đây
mục cha
commit
48c764026e
1 tập tin đã thay đổi với 4 bổ sung4 xóa
  1. 4 4
      Gameserver/Amfphp/process/StoreProc.php

+ 4 - 4
Gameserver/Amfphp/process/StoreProc.php

@@ -180,23 +180,23 @@ class StoreProc {
 
     public static function DailyRefreshWeapon($npcid = null) {
         //没有数据初始化,有数据不在管                   
-        if ($npcid != null && !StlUtil::dictHasProperty(ctx()->store()->weaponPool, $npcid)) {
-            $ret = new \stdClass();
+        if ($npcid != null && !StlUtil::dictHasProperty(ctx()->store()->weaponPool, $npcid)) {           
             $list = GameConfig::shop_weapon_getItemArray($npcid);
 
             foreach ($list as $value) {
+                $ret = new \stdClass();
                 $arr = explode(';', $value->weaponlist);
                 foreach ($arr as $item) {
                     $itemList = explode(',', $item);
                     $id = $itemList[0];
                     $per = $itemList[1];
                     $ret->$id = $per;
-                }
+                }            
                 $retArr = array();
                 $type = $value->id;
                 $pArr = self::randweapon($ret, $value->num);
                 //数组合并
-                $retArr = array_merge($retArr, $pArr);
+                $retArr = array_merge($retArr, $pArr);              
                 ctx()->store()->weaponPool->$npcid->$type = $retArr;
             }
         } else {