I think that the error fixed in the previous commit...
...(about clearing fog+shroud) caused repetition in the vector cleared_locations. But the use of std::unique was completely wrong (unique need a sorted vector and don't remove anything, but give you the new "end" iterator to use). Now it's not needed anymore. PS: we could use a std::set, but vector is normally more efficient.
This commit is contained in:
parent
22d5eb4c12
commit
3af9bb4dbd
1 changed files with 1 additions and 7 deletions
|
@ -1849,13 +1849,7 @@ bool clear_shroud_unit(const gamemap& map,
|
|||
clear_shroud_loc(map,teams[team],i->first,&cleared_locations);
|
||||
}
|
||||
|
||||
// Clear the location the unit is at
|
||||
clear_shroud_loc(map,teams[team],loc,&cleared_locations);
|
||||
|
||||
// Remove all redundant location.
|
||||
// If a unit is on this location, the sighed event is called twice.
|
||||
std::unique(cleared_locations.begin(),cleared_locations.end());
|
||||
|
||||
// clear_shroud_loc is supposed not introduce repetition in cleared_locations
|
||||
for(std::vector<gamemap::location>::const_iterator it =
|
||||
cleared_locations.begin(); it != cleared_locations.end(); ++it) {
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue