- bugfix for team switching vote calculation
This commit is contained in:
parent
37fd0d6c71
commit
4d31968966
|
@ -778,7 +778,8 @@ void Commander::giveNetworkCommand(NetworkCommand* networkCommand) const {
|
|||
}
|
||||
|
||||
// If > 50% of team vote yes, switch th eplayers team
|
||||
if(newTeamVotedYes / newTeamTotalMemberCount > 0.5) {
|
||||
if(newTeamTotalMemberCount > 0 && newTeamVotedYes > 0 &&
|
||||
newTeamVotedYes / newTeamTotalMemberCount > 0.5) {
|
||||
Faction *faction = world->getFaction(factionIndex);
|
||||
int oldTeam = faction->getTeam();
|
||||
faction->setTeam(vote->newTeam);
|
||||
|
|
Loading…
Reference in New Issue
Block a user