summaryrefslogtreecommitdiffstats
path: root/src/control/Garages.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-03-30 23:46:44 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-03-30 23:46:44 +0200
commit24e4ecf5bbf8c419c9e303e46db18f1323175458 (patch)
tree0b3dd951f745e69de70cd46d9b842585cbcba55d /src/control/Garages.cpp
parentMerge branch 'master' into garages_dev (diff)
downloadre3-24e4ecf5bbf8c419c9e303e46db18f1323175458.tar
re3-24e4ecf5bbf8c419c9e303e46db18f1323175458.tar.gz
re3-24e4ecf5bbf8c419c9e303e46db18f1323175458.tar.bz2
re3-24e4ecf5bbf8c419c9e303e46db18f1323175458.tar.lz
re3-24e4ecf5bbf8c419c9e303e46db18f1323175458.tar.xz
re3-24e4ecf5bbf8c419c9e303e46db18f1323175458.tar.zst
re3-24e4ecf5bbf8c419c9e303e46db18f1323175458.zip
Diffstat (limited to '')
-rw-r--r--src/control/Garages.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index f7211272..c63818e1 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -489,7 +489,7 @@ void CGarage::Update()
DMAudio.PlayFrontEndSound(SOUND_GARAGE_BOMB_ALREADY_SET, 1);
break;
}
- if (!CGarages::BombsAreFree && CWorld::Players[CWorld::PlayerInFocus].m_nMoney >= BOMB_PRICE) {
+ if (!CGarages::BombsAreFree && CWorld::Players[CWorld::PlayerInFocus].m_nMoney < BOMB_PRICE) {
CGarages::TriggerMessage("GA_4", -1, 4000, -1); // "Car bombs are $1000 each"
m_eGarageState = GS_OPENEDCONTAINSCAR;
DMAudio.PlayFrontEndSound(SOUND_GARAGE_NO_MONEY, 1);
@@ -1973,23 +1973,23 @@ bool CGarages::IsPointInAGarageCameraZone(CVector point)
for (int i = 0; i < NUM_GARAGES; i++) {
switch (aGarages[i].m_eGarageType) {
case GARAGE_NONE:
- continue;
+ break;
case GARAGE_COLLECTCARS_1:
case GARAGE_COLLECTCARS_2:
case GARAGE_COLLECTCARS_3:
- if (aGarages[i].m_fX1 - MARGIN_FOR_CAMERA_COLLECTCARS < point.x ||
- aGarages[i].m_fX2 - MARGIN_FOR_CAMERA_COLLECTCARS > point.x ||
- aGarages[i].m_fY1 - MARGIN_FOR_CAMERA_COLLECTCARS < point.y ||
- aGarages[i].m_fY2 - MARGIN_FOR_CAMERA_COLLECTCARS > point.y)
- continue;
- return true;
+ if (aGarages[i].m_fX1 - MARGIN_FOR_CAMERA_COLLECTCARS <= point.x &&
+ aGarages[i].m_fX2 + MARGIN_FOR_CAMERA_COLLECTCARS >= point.x &&
+ aGarages[i].m_fY1 - MARGIN_FOR_CAMERA_COLLECTCARS <= point.y &&
+ aGarages[i].m_fY2 + MARGIN_FOR_CAMERA_COLLECTCARS >= point.y)
+ return true;
+ break;
default:
- if (aGarages[i].m_fX1 - MARGIN_FOR_CAMERA_DEFAULT < point.x ||
- aGarages[i].m_fX2 - MARGIN_FOR_CAMERA_DEFAULT > point.x ||
- aGarages[i].m_fY1 - MARGIN_FOR_CAMERA_DEFAULT < point.y ||
- aGarages[i].m_fY2 - MARGIN_FOR_CAMERA_DEFAULT > point.y)
- continue;
- return true;
+ if (aGarages[i].m_fX1 - MARGIN_FOR_CAMERA_DEFAULT <= point.x &&
+ aGarages[i].m_fX2 + MARGIN_FOR_CAMERA_DEFAULT >= point.x &&
+ aGarages[i].m_fY1 - MARGIN_FOR_CAMERA_DEFAULT <= point.y &&
+ aGarages[i].m_fY2 + MARGIN_FOR_CAMERA_DEFAULT >= point.y)
+ return true;
+ break;
}
}
return false;