This commit is contained in:
aozhiwei 2021-05-20 20:15:44 +08:00
parent e50e2c4d36
commit 51f7d3eefa
2 changed files with 13 additions and 2 deletions

View File

@ -107,6 +107,16 @@ void Entity::BroadcastFullState(Room* room)
void Entity::BroadcastDeleteState(Room* room)
{
#if 1
room->TouchHumanList
(
a8::XParams(),
[this] (Human* hum, a8::XParams& param) -> bool
{
hum->RemoveObjects(this);
return true;
});
#else
std::set<GridCell*> tmp_grids;
room->grid_service->GetAllCells(room, grid_id_, tmp_grids);
room->grid_service->TouchAllLayerHumanList
@ -117,6 +127,7 @@ void Entity::BroadcastDeleteState(Room* room)
{
hum->RemoveObjects(this);
});
#endif
}
void Entity::RemoveFromAroundPlayers(Room* room)

View File

@ -309,8 +309,8 @@ void Hero::BeKill(int killer_id, const std::string& killer_name, int weapon_id)
hero->delete_frameno = hero->room->GetFrameNo();
std::vector<Human*> watch_list;
hero->room->GetPartObjectWatchList(hero, watch_list);
if (watch_list.empty()) {
if (!watch_list.empty()) {
abort();
}
},
&xtimer_attacher.timer_list_);