prevent duplicate advances_from entries.
This commit is contained in:
parent
6ccb8144b3
commit
f15b38f500
1 changed files with 2 additions and 1 deletions
|
@ -900,7 +900,8 @@ const std::string& unit_type::race() const
|
|||
// Allow storing "advances from" info for convenience in Help.
|
||||
void unit_type::add_advancesfrom(std::string unit_id)
|
||||
{
|
||||
advances_from_.push_back(unit_id);
|
||||
if (find(advances_from_.begin(), advances_from_.end(), unit_id) == advances_from_.end())
|
||||
advances_from_.push_back(unit_id);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue