This commit is contained in:
aozhiwei 2023-04-02 17:03:06 +08:00
parent ff31a1d4b1
commit 4b4fed3a62

View File

@ -22,6 +22,10 @@ bool Collision::CheckBullet(IBullet* bullet, Entity* e)
{
if (e->IsEntityType(ET_Obstacle) && ((Obstacle*)e)->IsRoomObstacle()) {
RoomObstacle* ob = (RoomObstacle*)e;
float distance = std::fabs(bullet->GetPos().GetX() - e->GetPos().GetX()) + std::fabs(bullet->GetPos().GetZ() - e->GetPos().GetZ());
if (distance > 300) {
return false;
}
}
return false;
}