Game Rating: Clean up some formatting and faulty logic that I missed before #519
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.
Now that I've spent some more time analysing game results, I realized that our game rating consistency checks were not quite right. Each army should have a consistent result reported (e.g. each player reports that army 1 was defeated) but each player on a team will not necessarily have the same game result. For instance if a player dies, but their teammates still carry them to victory, then the winning team will have at least one player with a
defeat
result and at least one player with avictory
result. For this reason,victory
results take precedence over all other results.I also snuck in some other refactors like fixing functions that didn't exist or using
is
operator for numeric comparison instead of==
. All things that I missed when reading the code on github, but my linter caught easily.