This commit is contained in:
aozhiwei 2024-04-15 14:30:00 +08:00
parent fdd88cc7d8
commit d2369f7280

View File

@ -139,13 +139,15 @@ void Bullet::OnHit(std::set<Entity*>& objects)
bool eat = false;
if (!trace_target_id && !reporter_list) {
if (mt::Param::s().bullet_through_wall_check) {
if (!room->BulletCanReach(born_pos.ToGlmVec3(), target->GetPos().ToGlmVec3())) {
if (!gun_meta->is_penetrate_thing() &&
!room->BulletCanReach(born_pos.ToGlmVec3(), target->GetPos().ToGlmVec3())) {
eat = true;
}
if (gun_meta->id() == 30905 && eat && sender.Get()) {
glm::vec3 new_born_pos = born_pos.ToGlmVec3();
new_born_pos.y = target->GetPos().GetY();
if (room->BulletCanReach(new_born_pos, target->GetPos().ToGlmVec3())) {
if (gun_meta->is_penetrate_thing() ||
room->BulletCanReach(new_born_pos, target->GetPos().ToGlmVec3())) {
eat = false;
}
}