From 6ae266d81ad7dfaf498cf6c2c0d20e1ce677165c Mon Sep 17 00:00:00 2001 From: hujiabin <519660157@qq.com> Date: Tue, 23 Jan 2024 14:52:48 +0800 Subject: [PATCH] 1 --- webapp/controller/BagController.class.php | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/webapp/controller/BagController.class.php b/webapp/controller/BagController.class.php index 18df866a..37721fb8 100644 --- a/webapp/controller/BagController.class.php +++ b/webapp/controller/BagController.class.php @@ -330,17 +330,16 @@ class BagController extends BaseAuthedController { } private function openBox($itemDb,$itemMeta,$itemNum){ + $dropMeta = mt\Drop::get($itemMeta['drop']); if (!$dropMeta) { $this->_rspErr(1, 'config error'); return; } - $costItems = array( - array( - "item_id" => V_ITEM_GOLD, - "item_num" => $itemMeta['gold'] * $itemNum - ) - ); + $costItems = mt\Item::getUseCostItems($itemMeta); + foreach ($costItems as &$costItem){ + $costItem['item_num'] *= $itemNum; + } $lackItem = null; if (!$this->_hasEnoughItems($costItems, $lackItem)) { $this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));