1
This commit is contained in:
parent
ac88401051
commit
6ae266d81a
@ -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));
|
||||
|
Loading…
x
Reference in New Issue
Block a user