This commit is contained in:
aozhiwei 2024-10-08 15:15:23 +08:00
parent b6f62d22b4
commit 52b6a66dfa

View File

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