This commit is contained in:
hujiabin 2024-04-29 14:45:09 +08:00
parent 3b2a2fda02
commit fb47b4a469

View File

@ -225,16 +225,16 @@ class RoomBattleDataService extends BaseService {
} }
//宝箱掉落 //宝箱掉落
$rand = $rewardMeta['chestLootProb'] * 100; if ($rewardMeta['chestLootProb'] > 0){
$rnd = rand(1,100); $rand = $rewardMeta['chestLootProb'] * 100;
if ($rnd <= $rand){ $rnd = rand(1,100);
$chestItems = LootService::dropOutItem($rewardMeta['chestLoot']); if ($rnd <= $rand){
foreach ($chestItems as $item){ $chestItems = LootService::dropOutItem($rewardMeta['chestLoot']);
array_push($reward,$item); foreach ($chestItems as $item){
array_push($reward,$item);
}
} }
} }
} }
} }