소스 검색

宝石镶嵌bug修复

cyzhao 4 일 전
부모
커밋
fccacfbe61
1개의 변경된 파일23개의 추가작업 그리고 4개의 파일을 삭제
  1. 23 4
      Gameserver/App/process/StoreProc.php

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

@@ -963,13 +963,32 @@ class StoreProc {
         switch ($type) {
             case 1://镶嵌
                 my_Assert($tag_gem == null, ErrCode::user_store_GemCanotSet);
-                $go_index = 1;
-                foreach ($gemSetSlotDic as $slotId => $gemUid) {
-                    if($gemUid == 0){
-                        $go_index = $slotId;
+                $go_index = 0;
+                for ($i = 1; $i <= $mo->initNum_slot; $i++) {
+                    if($gemSetSlotDic->$i == 0){
+                        $go_index = $i;
                         break;
                     }
                 }
+                if($go_index == 0){
+                    $num = 5-$mo->buyNum_slot+1;
+                    for ($i = $num; $i <= 5; $i++) {
+                        if($gemSetSlotDic->$i == 0){
+                            $go_index = $i;
+                            break;
+                        }
+                    }
+                }
+                    
+                
+                
+                
+//                foreach ($gemSetSlotDic as $slotId => $gemUid) {
+//                    if($gemUid == 0){
+//                        $go_index = $slotId;
+//                        break;
+//                    }
+//                }
                 
 //                for ($i = 1; $i <= $mo->initNum_slot + $mo->buyNum_slot; $i++) {
 //                    if (!StlUtil::dictHasProperty($gemSetSlotDic, $i)) {