Recalculate team scores in FFA when a player leaves - #384
Open
TheGiraffe3 wants to merge 1 commit into
Open
Conversation
Contributor
|
Plugin API event example below: bz_PlayerJoinPartEventData_V1* partData = (bz_PlayerJoinPartEventData_V1*)eventData;
if ((bz_getGameType() == eFFAGame) && (partData->record->team != eObservers)) {
bz_setTeamWins(partData->record->team, bz_getTeamWins(partData->record->team) - (partData->record->wins));
bz_setTeamLosses(partData->record->team, bz_getTeamLosses(partData->record->team) - (partData->record->losses));
}Team switching might need to be figured out in the long run. |
Contributor
Author
|
What do you mean by "team switching might need to be figured out"? |
Contributor
I haven't checked into it, but for the next major release (2.6), there's a feature of team switching. It probably doesn't trigger a part/leave event, which means team scores might be impacted there. |
TheGiraffe3
force-pushed
the
recalculate-ffa-scores-on-leave
branch
from
June 3, 2026 12:50
850124d to
a5abf3c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
On maps like Badgerking where there are a lot of deaths, you can sometimes end up with a team score of -50 while the only player on that team has a score of -2. This pull request fixes that by recalculating team scores whenever a player leaves.