This commit is contained in:
aozhiwei 2020-06-03 16:53:39 +08:00
parent 4ce77a7e08
commit a39bab2e4b

View File

@ -1796,34 +1796,38 @@ void Human::ClearFrameData()
new_objects.clear(); new_objects.clear();
} }
if (!del_objects.empty()) { if (!del_objects.empty()) {
for (auto& itr : del_objects) { if (!a8::HasBitFlag(status, HS_Disable)) {
Entity* entity = room->GetEntityByUniId(itr); for (auto& itr : del_objects) {
if (entity) { Entity* entity = room->GetEntityByUniId(itr);
RemovePartObjects(entity); if (entity) {
if (entity->IsEntityType(ET_Player)) { RemovePartObjects(entity);
Human* hum = (Human*)entity; if (entity->IsEntityType(ET_Player)) {
hum->RemovePartObjects(this); Human* hum = (Human*)entity;
} hum->RemovePartObjects(this);
}
#ifdef DEBUG #ifdef DEBUG
room->CheckPartObjects(); room->CheckPartObjects();
#endif #endif
}
} }
} }
del_objects.clear(); del_objects.clear();
} }
if (!out_objects.empty()) { if (!out_objects.empty()) {
for (auto& itr : out_objects) { if (!a8::HasBitFlag(status, HS_Disable)) {
Entity* entity = room->GetEntityByUniId(itr); for (auto& itr : out_objects) {
if (entity) { Entity* entity = room->GetEntityByUniId(itr);
RemovePartObjects(entity); if (entity) {
if (entity->IsEntityType(ET_Player)) { RemovePartObjects(entity);
Human* hum = (Human*)entity; if (entity->IsEntityType(ET_Player)) {
hum->RemovePartObjects(this); Human* hum = (Human*)entity;
hum->RemovePartObjects(this);
}
} }
}
#ifdef DEBUG #ifdef DEBUG
room->CheckPartObjects(); room->CheckPartObjects();
#endif #endif
}
} }
out_objects.clear(); out_objects.clear();
} }