1
This commit is contained in:
parent
ff31a1d4b1
commit
4b4fed3a62
@ -22,6 +22,10 @@ bool Collision::CheckBullet(IBullet* bullet, Entity* e)
|
|||||||
{
|
{
|
||||||
if (e->IsEntityType(ET_Obstacle) && ((Obstacle*)e)->IsRoomObstacle()) {
|
if (e->IsEntityType(ET_Obstacle) && ((Obstacle*)e)->IsRoomObstacle()) {
|
||||||
RoomObstacle* ob = (RoomObstacle*)e;
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user