This commit is contained in:
aozhiwei 2024-10-08 15:12:07 +08:00
parent 6267ef51a7
commit b6f62d22b4

View File

@ -20,19 +20,13 @@ class BattleBoxService {
$currPhase = self::getCurrentPhase();
$allocableNum = self::getDailyPhaseAllocNum($currPhase, myself()->_getNowDaySeconds());
$alreadyAllocNum = self::getDailyPhaseAlreadyAllocNum($currPhase, myself()->_getNowDaySeconds());
if ($allocNum > 0) {
if ($allocableNum > 0) {
$lstVal = mt\Parameter::getListValue('battle_event_loot_per_game');
if ($allocableNum <= 0 || empty($lstVal) || count($lstVal) < 2) {
myself()->_rspData(array(
'box_num' => 0
));
return;
}
$rnd = rand($lstVal[0], $lstVal[1]);
if ($rnd <= 0) {
myself()->_rspData(array(
'box_num' => 0
));
return;
}
$boxNum = min($rnd, $allocableNum);