diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 774325aa..9b525a74 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -268,13 +268,26 @@ class BagController extends BaseAuthedController { $this->_rspErr(1, "only supported rename card"); return; } + $costItems= array( + array( + 'item_id' => V_ITEM_GOLD, + 'item_num' => $itemMeta['gold'] + ) + ); + $lackItem = null; + if (!$this->_hasEnoughItems($costItems, $lackItem)) { + $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem)); + return; + } $items = array( array( 'item_id' => $itemId, 'item_num' => 1 ) ); + $this->_decItems($costItems); $this->_addItems($items, $this->awardService, $this->propertyChgService); + $this->propertyChgService->addUserChg(); $this->propertyChgService->addBagChg(); $this->_rspData(array( 'award' => $this->awardService->toDto(),