Browse Source

章节宝箱bug

cyzhao 6 months ago
parent
commit
82cc143e65
1 changed files with 2 additions and 1 deletions
  1. 2 1
      Gameserver/App/process/ShopProc.php

+ 2 - 1
Gameserver/App/process/ShopProc.php

@@ -183,6 +183,7 @@ class ShopProc {
 
         $mo = GameConfig::shop_gategift_getItem($typeId);
         my_Assert($mo != null, ErrCode::err_const_no);
+        my_Assert(ctx()->baseInfo->cash>= $mo->price, ErrCode::notenough_cash_msg);
         StoreProc::AddMultiItemInStore($mo->reward);
 //        $price = explode(';', $mo->reward);
 //        foreach ($price as $value) {
@@ -206,7 +207,7 @@ class ShopProc {
 //        foreach ($gateGift as $str) {
 //            StoreProc::AddMultiItemInStore($str);
 //        }
-        ctx()->privateData(true)->gateGiftReceived[] = $typeId;
+        ctx()->privateData(true)->gateGiftReceived[] = $typeId;       
         ctx()->baseInfo->Consume_Cash($mo->price);
 
         //return $gateGift;