Commit b8abf66a authored by grunt92's avatar grunt92
Browse files

entities werden nur einmal gelöscht

parent 78fd0fc9
......@@ -56,13 +56,32 @@ namespace gdw {
auto type_comp = collider->component<object_type_component>();
if(type_comp){
if(type_comp->get_object_type()=="VICTIM"){
doomed.push_back(s);
bool is_member = false;
if(doomed.empty()){
doomed.push_back(s);
}
else{
for(int i = 0; i <= doomed.size(); i++){
if(s==doomed.at(i)){
is_member = true;
}
if(is_member == false && i == doomed.size()){
doomed.push_back(s);
}
}}
// engine_.entity_manager().erase(s);
//engine_.game_play_system().gamemanager().add_points(1);
//list_helper::removeElement(victims_, s);
}
}
}
while(!doomed.empty()){
engine_.entity_manager().erase(doomed.back());
doomed.pop_back();
}
engine_.entity_manager().erase(self_id);
}
......@@ -72,10 +91,7 @@ namespace gdw {
}
while(!doomed.empty()){
engine_.entity_manager().erase(doomed.back());
doomed.pop_back();
}
......
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