fix garages

This commit is contained in:
Nikolay Korolev 2020-11-27 19:18:51 +03:00
parent 8c275c3e01
commit f50a53e290
3 changed files with 7 additions and 7 deletions

View File

@ -1260,9 +1260,9 @@ bool CGarage::IsPlayerOutsideGarage()
bool CGarage::IsEntityTouching3D(CEntity * pEntity) bool CGarage::IsEntityTouching3D(CEntity * pEntity)
{ {
float radius = pEntity->GetBoundRadius(); float radius = pEntity->GetBoundRadius();
if (pEntity->GetPosition().x - radius < m_fX1 || pEntity->GetPosition().x + radius > m_fX2 || if (m_fX1 - radius > pEntity->GetPosition().x || m_fX2 + radius < pEntity->GetPosition().x ||
pEntity->GetPosition().y - radius < m_fY1 || pEntity->GetPosition().y + radius > m_fY2 || m_fY1 - radius > pEntity->GetPosition().y || m_fY2 + radius < pEntity->GetPosition().y ||
pEntity->GetPosition().z - radius < m_fZ1 || pEntity->GetPosition().z + radius > m_fZ2) m_fZ1 - radius > pEntity->GetPosition().z || m_fZ2 + radius < pEntity->GetPosition().z)
return false; return false;
CColModel* pColModel = pEntity->GetColModel(); CColModel* pColModel = pEntity->GetColModel();
for (int i = 0; i < pColModel->numSpheres; i++) { 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 && if (pos.x + radius > m_fX1 && pos.x - radius < m_fX2 &&
pos.y + radius > m_fY1 && pos.y - radius < m_fY2 && pos.y + radius > m_fY1 && pos.y - radius < m_fY2 &&
pos.z + radius > m_fZ1 && pos.z - radius < m_fZ2) 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) bool CGarage::EntityHasASphereWayOutsideGarage(CEntity * pEntity, float fMargin)

2
vendor/ogg vendored

@ -1 +1 @@
Subproject commit 36f969bb37559345ee03796ed625a9abd42c6db9 Subproject commit 31bd3f2707fb7dbae539a7093ba1fc4b2b37d84e

2
vendor/opus vendored

@ -1 +1 @@
Subproject commit 034c1b61a250457649d788bbf983b3f0fb63f02e Subproject commit 841d57b82a516ccc6e90d1d4aee8d4a7f0d00010