瀏覽代碼

兑换bug修复

cyzhao 8 月之前
父節點
當前提交
f140c9e4e4
共有 1 個文件被更改,包括 6 次插入4 次删除
  1. 6 4
      Gameserver/App/process/ActiveProc.php

+ 6 - 4
Gameserver/App/process/ActiveProc.php

@@ -54,12 +54,14 @@ class ActiveProc {
         my_Assert($num < $mo->exchangeNum,ErrCode::active_lotteryExchangeNumLimit);
         
         $itemNum = 0;
-        if(StlUtil::dictHasProperty(ctx()->store->items, $id)){
-            $itemNum = ctx()->store->items->$id;
-        }
         $cost = explode(',',$mo->cost);
+        $costId = $cost[0];
+        if(StlUtil::dictHasProperty(ctx()->store->items, $costId)){
+            $itemNum = ctx()->store->items->$costId;
+        }
+        
         my_Assert($itemNum >= $cost[1],ErrCode::notenough_item);
-        ctx()->store->removeItem($cost[0], $cost[1]);
+        ctx()->store->removeItem($costId, $cost[1]);
         
         StoreProc::AddMultiItemInStore($mo->reward);
         ctx()->privateState->lotteryExchange[] = $id;