This commit is contained in:
aozhiwei 2023-10-30 11:29:16 +08:00
parent c835fbb13c
commit abe42b4636
3 changed files with 31 additions and 0 deletions

View File

@ -320,6 +320,9 @@ void FrameMaker::SerializeShots(cs::SMUpdate* msg, Room* room, Human* hum, Frame
if (idx < room->frame_event_data->shots_.size()) { if (idx < room->frame_event_data->shots_.size()) {
auto& tuple = room->frame_event_data->shots_[idx]; auto& tuple = room->frame_event_data->shots_[idx];
if (std::get<0>(tuple).Get() && hum->CanSee(std::get<0>(tuple).Get())) { if (std::get<0>(tuple).Get() && hum->CanSee(std::get<0>(tuple).Get())) {
if (std::get<0>(tuple).Get()->IsPlayer()) {
a8::XPrintf("player shot\n", {});
}
*msg->add_shots() = std::get<1>(tuple); *msg->add_shots() = std::get<1>(tuple);
} else { } else {
#ifdef DEBUG1 #ifdef DEBUG1

View File

@ -128,6 +128,7 @@ namespace mt
} }
collider_info = MapCollider::GetByName(map_collider()); collider_info = MapCollider::GetByName(map_collider());
LoadWorldObjects(); LoadWorldObjects();
PostProcess();
} }
void Map::Init2() void Map::Init2()
@ -289,4 +290,30 @@ namespace mt
return sampling_pos_; return sampling_pos_;
} }
void Map::PostProcess()
{
if (!is_moba()) {
return;
}
std::vector<int> del_ids;
std::vector<std::shared_ptr<WorldObject>> born_points;
int idx = 0;
for (auto& obj : _world_objects) {
if (obj->object_type == WorldObjectType_e::kBoxType) {
if (obj->object_id == 80012) {
born_points.push_back(obj);
del_ids.push_back(idx);
}
}
++idx;
}
std::sort(del_ids.begin(), del_ids.end(),
[] (int a, int b) {
return a > b;
});
for (auto idx : del_ids) {
_world_objects.erase(_world_objects.begin() + idx);
}
}
} }

View File

@ -54,6 +54,7 @@ namespace mt
glm::vec3 sampling_pos_; glm::vec3 sampling_pos_;
void LoadWorldObjects(); void LoadWorldObjects();
void PostProcess();
}; };
} }