don't use a constant end iterator to terminate an erasing loop
This commit is contained in:
parent
e6d86722f1
commit
96def93067
1 changed files with 2 additions and 2 deletions
|
@ -771,8 +771,8 @@ void unit::remove_ability_by_id(const std::string &ability)
|
|||
{
|
||||
config* abil = cfg_.child("abilities");
|
||||
if(abil) {
|
||||
config::all_children_iterator i = abil->ordered_begin(), i_end = abil->ordered_end();
|
||||
while(i != i_end) {
|
||||
config::all_children_iterator i = abil->ordered_begin();
|
||||
while(i != abil->ordered_end()) {
|
||||
if(i.get_child()["id"] == ability) {
|
||||
i = abil->erase(i);
|
||||
} else {
|
||||
|
|
Loading…
Add table
Reference in a new issue