Commit dd25a24e authored by salix5's avatar salix5

fix Group.Remove

parent 9605c451
...@@ -640,11 +640,13 @@ int32 scriptlib::group_remove(lua_State *L) { ...@@ -640,11 +640,13 @@ int32 scriptlib::group_remove(lua_State *L) {
if(pgroup->is_readonly == 1) if(pgroup->is_readonly == 1)
return 0; return 0;
for (auto cit = pgroup->container.begin(); cit != pgroup->container.end();) { for (auto cit = pgroup->container.begin(); cit != pgroup->container.end();) {
auto rm = cit++; if((*cit) != pexception && pduel->lua->check_matching(*cit, 2, extraargs)) {
if((*rm) != pexception && pduel->lua->check_matching(*rm, 2, extraargs)) { cit = pgroup->container.erase(cit);
pgroup->container.erase(rm);
} }
else
++cit;
} }
pgroup->it = pgroup->container.begin();
return 0; return 0;
} }
int32 scriptlib::group_merge(lua_State *L) { int32 scriptlib::group_merge(lua_State *L) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment