Use math.ceil instead of math.Round #53
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I think that math.ceil handles edge cases like 1-2 players a lot better than math.Round.
For example when there are 2 players you probably don't want the map vote to trigger when just 1 votes to change the map. So you either have to:
a) Set percentage of players who need to RTV to 0.75+
b) Set minimum players to enable RTVing to 3+
Both of these options can be undesirable because:
a) Players are sloths and it can be hard to get 75% to RTV when there are more people on
b) It completely blocks map changing when there are <2 players on the server, which can be frustrating
Also consider that math.ceil behaves exactly the same as if no rounding is done at all, which makes more sense for me