Fixed additional casting issues in queue wait time decay rate calculation.
This commit is contained in:
@@ -266,10 +266,10 @@ public class MatchManager implements Listener, Runnable {
|
|||||||
* @return The amount of ticks per second the queue wait time will decay, up to 10.
|
* @return The amount of ticks per second the queue wait time will decay, up to 10.
|
||||||
*/
|
*/
|
||||||
public int getQueueDecayRate(){
|
public int getQueueDecayRate(){
|
||||||
final float availablePlayers = this.snowbrawl.getServer().getOnlinePlayers().size() - this.getPlayersInMatches().size(); // The amount of players online but not in a match.
|
final double availablePlayers = this.snowbrawl.getServer().getOnlinePlayers().size() - this.getPlayersInMatches().size(); // The amount of players online but not in a match.
|
||||||
final float queuedPlayers = this.getQueuedPlayers().size(); // The amount of queued players.
|
final double queuedPlayers = this.getQueuedPlayers().size(); // The amount of queued players.
|
||||||
|
|
||||||
final int decayRate = (int) (queuedPlayers / availablePlayers) * 10;
|
final int decayRate = (int) ((queuedPlayers / availablePlayers) * 10);
|
||||||
|
|
||||||
// Clamp decay rate between 1 and 10 ticks per second.
|
// Clamp decay rate between 1 and 10 ticks per second.
|
||||||
if (decayRate < 1){
|
if (decayRate < 1){
|
||||||
|
|||||||
Reference in New Issue
Block a user