summaryrefslogtreecommitdiffstats
path: root/src/control/Garages.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-11-28 16:02:21 +0100
committeraap <aap@papnet.eu>2020-11-28 16:02:21 +0100
commitb23bda6e45e0b0c87254b0518bfe3960f556032b (patch)
treeb53f048387bba3b8e544047407813e44bab01025 /src/control/Garages.cpp
parentstart using CMemoryHeap (diff)
parentfix garages (diff)
downloadre3-b23bda6e45e0b0c87254b0518bfe3960f556032b.tar
re3-b23bda6e45e0b0c87254b0518bfe3960f556032b.tar.gz
re3-b23bda6e45e0b0c87254b0518bfe3960f556032b.tar.bz2
re3-b23bda6e45e0b0c87254b0518bfe3960f556032b.tar.lz
re3-b23bda6e45e0b0c87254b0518bfe3960f556032b.tar.xz
re3-b23bda6e45e0b0c87254b0518bfe3960f556032b.tar.zst
re3-b23bda6e45e0b0c87254b0518bfe3960f556032b.zip
Diffstat (limited to 'src/control/Garages.cpp')
-rw-r--r--src/control/Garages.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index 5a04285f..fc8f84f2 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1260,9 +1260,9 @@ bool CGarage::IsPlayerOutsideGarage()
bool CGarage::IsEntityTouching3D(CEntity * pEntity)
{
float radius = pEntity->GetBoundRadius();
- if (pEntity->GetPosition().x - radius < m_fX1 || pEntity->GetPosition().x + radius > m_fX2 ||
- pEntity->GetPosition().y - radius < m_fY1 || pEntity->GetPosition().y + radius > m_fY2 ||
- pEntity->GetPosition().z - radius < m_fZ1 || pEntity->GetPosition().z + radius > m_fZ2)
+ if (m_fX1 - radius > pEntity->GetPosition().x || m_fX2 + radius < pEntity->GetPosition().x ||
+ m_fY1 - radius > pEntity->GetPosition().y || m_fY2 + radius < pEntity->GetPosition().y ||
+ m_fZ1 - radius > pEntity->GetPosition().z || m_fZ2 + radius < pEntity->GetPosition().z)
return false;
CColModel* pColModel = pEntity->GetColModel();
for (int i = 0; i < pColModel->numSpheres; i++) {
@@ -1271,9 +1271,9 @@ bool CGarage::IsEntityTouching3D(CEntity * pEntity)
if (pos.x + radius > m_fX1 && pos.x - radius < m_fX2 &&
pos.y + radius > m_fY1 && pos.y - radius < m_fY2 &&
pos.z + radius > m_fZ1 && pos.z - radius < m_fZ2)
- return false;
+ return true;
}
- return true;
+ return false;
}
bool CGarage::EntityHasASphereWayOutsideGarage(CEntity * pEntity, float fMargin)