diff --git a/server/gameserver/bullet.cc b/server/gameserver/bullet.cc index af795f5..386bfb6 100644 --- a/server/gameserver/bullet.cc +++ b/server/gameserver/bullet.cc @@ -367,6 +367,7 @@ void Bullet::Check(float distance) { int c_hit_num = 0; int t_hit_num = 0; + int o_hit_num = 0; std::set objects; { std::set colliders; @@ -374,6 +375,7 @@ void Bullet::Check(float distance) for (ColliderComponent* collider : colliders) { if (collider->owner->IsEntityType(ET_Dummy)) { if (TestCollision(room, collider)) { + ++o_hit_num; objects.insert(collider->owner); } } else if (collider->owner->IsEntityType(ET_Obstacle)) { @@ -388,6 +390,7 @@ void Bullet::Check(float distance) objects.insert(collider->owner); if (gun_meta->i->is_penetrate_thing()) { ++t_hit_num; + ++o_hit_num; hit_objects_.insert(collider->owner->GetUniId()); } } @@ -395,7 +398,7 @@ void Bullet::Check(float distance) } } } - if (t_hit_num <= 0) { + if (o_hit_num <= 0) { room->grid_service->TraverseCreatures (room->GetRoomIdx(), GetGridList(),