浏览代码

升星消耗言灵校验

cyzhao 4 年之前
父节点
当前提交
cd0a384739
共有 2 个文件被更改,包括 12 次插入2 次删除
  1. 5 0
      Gameserver/Amfphp/base/ErrCode.php
  2. 7 2
      Gameserver/Amfphp/process/HeroProc.php

+ 5 - 0
Gameserver/Amfphp/base/ErrCode.php

@@ -478,6 +478,11 @@ class ErrCode {
      * 
      */
     const hero_yanling_starMax = 3332;
+    
+    /**
+     * 错误的言灵
+     */
+    const hero_yanling_errorYanling= 3333;
 //
 // </editor-fold>
     //

+ 7 - 2
Gameserver/Amfphp/process/HeroProc.php

@@ -605,16 +605,21 @@ class HeroProc {
                     $tag = false;
                     break;
                 }
+                
+                if($store->yanling->$costUid->herouid != 0){
+                    $tag = false;
+                    break;
+                }
             } else {
                 $tag = false;
                 break;
             }
         }
 
-        my_Assert($tag, ErrCode::hero_yanling_notfound);
+        my_Assert($tag, ErrCode::hero_yanling_errorYanling);
         $exp = 0;
         foreach ($uidList as $costuid) {
-            $confDic = GameConfig::item_yanling_getItem($store->yanling->$costUid->typeId);
+            $confDic = GameConfig::item_yanling_getItem($store->yanling->$costuid->typeId);
             my_Assert(null != $confDic, ErrCode::hero_const_no_err);
             $exp += $confDic->addStarExp;
             StlUtil::dictRemove($store->yanling, $costuid);