mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
Backwards Compatibility for rolling dice
This commit is contained in:
parent
b7fbc12ac0
commit
f04702fdd1
2 changed files with 11 additions and 5 deletions
|
|
@ -1076,7 +1076,12 @@ Server_Player::cmdRollDie(const Command_RollDie &cmd, ResponseContainer & /*rc*/
|
|||
Event_RollDie event;
|
||||
event.set_sides(validatedSides);
|
||||
for (auto i = 0; i < validatedDiceToRoll; ++i) {
|
||||
event.add_values(rng->rand(1, validatedSides));
|
||||
const auto roll = rng->rand(1, validatedSides);
|
||||
if (i == 0) {
|
||||
// Backwards compatibility
|
||||
event.set_value(roll);
|
||||
}
|
||||
event.add_values(roll);
|
||||
}
|
||||
ges.enqueueGameEvent(event, playerId);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue