浏览代码

升级最大值bug

cyzhao 4 年之前
父节点
当前提交
9b389d1de1

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

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-03-24 14:26:01
+ // 日期: 2021-03-24 16:09:54
 ////////////////////
 
 /**

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_drop.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-03-18 16:57:32
+ // 日期: 2021-03-24 15:35:06
 ////////////////////
 
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_gate.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-03-24 09:48:16
+ // 日期: 2021-03-24 15:53:27
 ////////////////////
 
 

+ 6 - 6
Gameserver/Amfphp/model/Const/sm_item_base.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-03-24 13:45:30
+ // 日期: 2021-03-24 16:05:49
 ////////////////////
 
 
@@ -33,6 +33,11 @@ class sm_item_base
     */
     public $img;
 
+    /**
+    * @var String item的关卡途径  
+    */
+    public $gateChannel;
+
     /**
     * @var String 物品模型资源  
     */
@@ -124,10 +129,5 @@ class sm_item_base
     */
     public $quality;
 
-    /**
-    * @var String item的关卡途径  
-    */
-    public $channel;
-
 }
 

+ 1 - 1
Gameserver/Amfphp/model/Const/sm_item_taskcard.php

@@ -3,7 +3,7 @@
  // 由CodeGenerator创建。
  // Copyright (C) gwang (wanggangzero@qq.com), Loyalsoft@sjz Inc
  // author: gwang 
- // 日期: 2021-03-19 17:50:30
+ // 日期: 2021-03-24 15:54:45
 ////////////////////
 
 

+ 22 - 24
Gameserver/Amfphp/process/HeroProc.php

@@ -1046,20 +1046,11 @@ class HeroProc {
             return Resp::err(ErrCode::hero_yanling_levelMax);
         }
                              
-        $maxLv = $curlv + $type;
-
-//        for ($index = $curlv; $index < $maxLv; $index++) {
-//            $mo = GameConfig::yanlingLeve_getItem($index);
-//            $costList = explode(';', $mo->cost);
-//            foreach ($costList as $item) {
-//                $list = explode(',', $item);
-//                if ($list[0] == META_GOLD_ITEMID) {//扣金币
-//                    Data_UserGame::Consume_Gold($req->userInfo->game->baseInfo, $list[1]);
-//                } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点
-//                    Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $list[1]);
-//                }
-//            }
-//        }     
+        $maxLv = $curlv + $type;      
+        if($maxLv > $maxLevel ){
+            $maxLv = $maxLevel;
+        }
+             
         $goldNum = 0; 
         $pointNum = 0; 
         for ($index = $curlv; $index < $maxLv; $index++) {           
@@ -1067,17 +1058,20 @@ class HeroProc {
                 return Resp::err(ErrCode::hero_yanling_levelconst_no);
             }
             $mo = GameConfig::yanlingLeve_getItem($index);
-            $cost = '1,'.$mo->goldCost.';'. '8,'.$mo->pointCost;
+            //$cost = '1,'.$mo->goldCost.';'. '8,'.$mo->pointCost;
             
-            $costList = explode(';',$cost);             
-            foreach ($costList as $item) {
-                $list = explode(',', $item);
-                if($list[0] == META_GOLD_ITEMID){//扣金币
-                    $goldNum += $list[1];                   
-                } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点                   
-                     $pointNum += $list[1];
-                }
-            }                                      
+            $goldNum += $mo->goldCost;  
+            $pointNum += $mo->pointCost; 
+            
+//            $costList = explode(';',$cost);             
+//            foreach ($costList as $item) {
+//                $list = explode(',', $item);
+//                if($list[0] == META_GOLD_ITEMID){//扣金币
+//                    $goldNum += $list[1];                   
+//                } elseif ($list[0] == META_RESPOINT_ITEMID) {//扣除资源点                   
+//                     $pointNum += $list[1];
+//                }
+//            }                                      
         }
         
         if($req->userInfo->game->baseInfo->gold < $goldNum){
@@ -1091,6 +1085,10 @@ class HeroProc {
         Data_UserGame::Consume_ResPoint($req->userInfo->game->baseInfo, $pointNum);
         
         $store->yanling->$yanlingUid->level += $type;
+        if($store->yanling->$yanlingUid->level > $maxLevel){
+            $store->yanling->$yanlingUid->level = $maxLevel;
+        }
+        
         $req->userInfo->game->store = $store;
 
         UserProc::updateUserInfo();