1
This commit is contained in:
parent
71bd866466
commit
38bd4ee265
@ -376,6 +376,15 @@ class BagController extends BaseAuthedController {
|
||||
}
|
||||
|
||||
private function openBattleBox($itemDb,$itemMeta,$itemNum){
|
||||
$costItems = mt\Item::getUseCostItems($itemMeta);
|
||||
if (count($costItems) > 0){
|
||||
$lackItem = null;
|
||||
if (!$this->_hasEnoughItems($costItems, $lackItem)) {
|
||||
$this->_rspErr(3, $this->_getLackItemErrMsg($lackItem));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
$lootMeta = mt\LootConfig::find($itemMeta['loot']);
|
||||
if ($lootMeta['isAffected']){
|
||||
// $lucky = Hero::getAccountLucky(myself()->_getAddress());
|
||||
@ -393,6 +402,9 @@ class BagController extends BaseAuthedController {
|
||||
}else{
|
||||
$items = \services\LootService::dropOutItem($itemMeta['loot']);
|
||||
}
|
||||
if (count($costItems) > 0){
|
||||
$this->_decItems($costItems);
|
||||
}
|
||||
$this->_decItems(array(
|
||||
array(
|
||||
'item_id' => $itemMeta['id'],
|
||||
|
Loading…
x
Reference in New Issue
Block a user