← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/bug-1302593-result-screen into lp:widelands

 

Extended reply.

Diff comments:

> 
> === modified file 'src/logic/playersmanager.cc'
> --- src/logic/playersmanager.cc	2016-02-16 10:27:23 +0000
> +++ src/logic/playersmanager.cc	2016-05-02 11:22:37 +0000
> @@ -120,5 +120,21 @@
>  	}
>  }
>  
> +void PlayersManager::set_player_end_status(const PlayerEndStatus& status)
> +{
> +	bool found = false;
> +	for (auto it = players_end_status_.begin(); it != players_end_status_.end(); ++it) {
> +		PlayerEndStatus pes = *it;
> +		if (pes.player == status.player) {
> +			pes = status;

You could also do "PlayerEndStatus & pes = *it; ... pes = status;" with iterators.

> +			found = true;
> +			break;
> +		}
> +	}
> +	if (!found) {
> +		players_end_status_.push_back(status);
> +	}
> +}
> +
>  
>  }  // namespace Widelands


-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1302593-result-screen/+merge/293521
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/bug-1302593-result-screen.


References