Explorar o código

洗练bug修复

cyzhao hai 1 ano
pai
achega
d881aa5ef9

+ 1 - 1
Gameserver/App/model/Const/GameConfig.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-09 17:20:28
+ // 日期: 2024-05-10 09:57:33
 ////////////////////
 
 /**

+ 1 - 1
Gameserver/App/model/Const/sm_predicate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2024-05-09 17:02:46
+ // 日期: 2024-05-10 09:32:56
 ////////////////////
 
 

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

@@ -80,16 +80,16 @@ class StoreProc {
         $dic = GameConfig::predicate();
         $pList = array();
         foreach ($dic as $id => $pMo) {
-            if($pMo->positions != null){
+            if($pMo->positions != null && $pMo->qual != null){
                 $list = explode(',',$pMo->positions);
                 if($pMo->id != $gem->predicateId && $pMo->qual == $gem->mo()->qual && in_array($gem->mo()->position, $list)){
                     $pList[] = $pMo->id;
                 }
             }                    
         }
-        
-        $rand = random_int(0, count($list)-1);
-        $pId = $list[$rand]; 
+        my_Assert(count($pList) > 0, ErrCode::user_store_GemNotXilian);
+        $rand = random_int(0, count($pList)-1);
+        $pId = $pList[$rand]; 
         ctx()->store->gemStore->$uid->predicateId = $pId;     
         
         ctx()->baseInfo->xilianStone -= $needStone;