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

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

@@ -469,6 +469,10 @@ class ErrCode {
      *言灵等级已达上限
      */
     const hero_yanling_levelMax = 3330;
+    /**
+     * 重复言灵
+     */
+     const hero_yanling_repeat = 3329;
 //
 // </editor-fold>
     //

+ 6 - 1
Gameserver/Amfphp/process/HeroProc.php

@@ -976,8 +976,13 @@ class HeroProc {
         if (!StlUtil::dictHasProperty($store->yanling, $yanlingUid)) {
             return Resp::err(ErrCode::hero_yanling_notfound);
         }
+        
+        if(in_array($yanlingUid, $uidList)){
+            return Resp::err(ErrCode::hero_yanling_repeat);
+        }
+        
         $tag = true;
-        foreach ($uidList as $costUid) {
+        foreach ($uidList as $costUid) {                             
             if (StlUtil::dictHasProperty($store->yanling, $costUid)) {//校验是否是同类型
                 $confDic = GameConfig::item_yanling_getItem($store->yanling->$costUid->typeId);
                 my_Assert(null != $confDic, ErrCode::hero_const_no_err);