functions.php: dice minimum value set to 1

This commit is contained in:
Zankaria 2024-10-14 10:13:05 +02:00
parent 3e857c16f6
commit a90b15d596

View file

@ -2815,7 +2815,7 @@ function handle_dice_roll_markup(array $matches, ?string $img_path): string {
$acc = ''; $acc = '';
$text = "$dice_count d $dice_faces + $dice_offset"; $text = "$dice_count d $dice_faces + $dice_offset";
for ($i = 0; $i < $dice_count; $i++) { for ($i = 0; $i < $dice_count; $i++) {
$res = $dice_offset + mt_rand(0, $dice_faces); $res = $dice_offset + mt_rand(1, $dice_faces);
if ($img_path === null) { if ($img_path === null) {
$fmt = "<span>$text </span> <b>$res</b>"; $fmt = "<span>$text </span> <b>$res</b>";
} else { } else {