mirror of
https://github.com/correl/mage.git
synced 2025-01-11 19:13:02 +00:00
Game: making sure that the pick timer is always at least 1 second (unless it's set to 0 deliberately) (#9850)
Co-authored-by: sprangg <a@b.c>
This commit is contained in:
parent
c8e02755bb
commit
1a96b0f065
1 changed files with 6 additions and 1 deletions
|
@ -310,7 +310,12 @@ public abstract class DraftImpl implements Draft {
|
|||
public void firePickCardEvent(UUID playerId) {
|
||||
DraftPlayer player = players.get(playerId);
|
||||
int cardNum = Math.min(15, this.cardNum);
|
||||
int time = timing.getPickTimeout(cardNum) - boosterLoadingCounter * BOOSTER_LOADING_INTERVAL;
|
||||
int time = timing.getPickTimeout(cardNum);
|
||||
// if the pack is re-sent to a player because they haven't been able to successfully load it, the pick time is reduced appropriately because of the elapsed time
|
||||
// the time is always at least 1 second unless it's set to 0, i.e. unlimited time
|
||||
if (time > 0) {
|
||||
time = Math.max(1, time - boosterLoadingCounter * BOOSTER_LOADING_INTERVAL);
|
||||
}
|
||||
playerQueryEventSource.pickCard(playerId, "Pick card", player.getBooster(), time);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue