This commit is contained in:
aozhiwei 2021-05-20 16:19:50 +08:00
parent 74c780bde7
commit cf7431a597
3 changed files with 14 additions and 3 deletions

View File

@ -45,7 +45,7 @@ cs::SMUpdate* FrameMaker::MakeUpdateMsg(Human* hum)
#endif
}
for (auto& itr : hum->part_objects) {
Entity* entity = itr;
Entity* entity = itr.first;
if (entity->IsDead(room) &&
hum->room->GetFrameNo() - entity->GetDeadFrameNo(room) > 10) {
continue;

View File

@ -963,7 +963,11 @@ void Human::AddToNewObjects(Entity* entity)
void Human::AddToPartObjects(Entity* entity)
{
part_objects.insert(entity);
PartObject part_obj;
part_obj.entity_uniid = entity->GetEntityUniId();
part_obj.entity_type = entity->GetEntityType();
part_obj.entity_subtype = entity->GetEntitySubType();
part_objects[entity] = part_obj;
}
void Human::RemovePartObjects(Entity* entity)

View File

@ -31,6 +31,13 @@ struct SpecMapObject
struct xtimer_list* enter_timer = nullptr;
};
struct PartObject
{
int entity_uniid = 0;
int entity_type = 0;
int entity_subtype = 0;
};
struct xtimer_list;
class CircleCollider;
class AabbCollider;
@ -308,7 +315,7 @@ protected:
std::array<int, IS_END> volume_ = {};
std::set<Entity*> new_objects;
std::set<Entity*> part_objects;
std::map<Entity*, PartObject> part_objects;
std::set<int> del_objects;
std::set<int> out_objects;
std::vector<int> shots_;