summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-01-23 14:09:54 +0100
committerGitHub <noreply@github.com>2021-01-23 14:09:54 +0100
commit4bde3366c1a2edb13f67b3fa9e1605573d8331bd (patch)
treef6b742f26201f0f5a28e2c12fba508ea41cc04f9 /src/control
parentRemove restrictions in CGame::Process (diff)
parentRemove size assert (diff)
downloadre3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.tar
re3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.tar.gz
re3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.tar.bz2
re3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.tar.lz
re3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.tar.xz
re3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.tar.zst
re3-4bde3366c1a2edb13f67b3fa9e1605573d8331bd.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/Bridge.cpp20
-rw-r--r--src/control/Bridge.h1
-rw-r--r--src/control/Garages.cpp83
3 files changed, 63 insertions, 41 deletions
diff --git a/src/control/Bridge.cpp b/src/control/Bridge.cpp
index 1e63cf30..e7c76a9c 100644
--- a/src/control/Bridge.cpp
+++ b/src/control/Bridge.cpp
@@ -161,3 +161,23 @@ bool CBridge::ThisIsABridgeObjectMovingUp(int index)
return false;
#endif
}
+
+void CBridge::ForceBridgeState(uint8 state)
+{
+#ifdef GTA_BRIDGE
+ State = state;
+ switch (state)
+ {
+ case STATE_BRIDGE_LOCKED:
+ case STATE_LIFT_PART_MOVING_DOWN:
+ case STATE_LIFT_PART_ABOUT_TO_MOVE_UP:
+ ThePaths.SetLinksBridgeLights(-330.0f, -230.0f, -700.0f, -588.0f, true);
+ break;
+ case STATE_BRIDGE_ALWAYS_UNLOCKED:
+ ThePaths.SetLinksBridgeLights(-330.0f, -230.0f, -700.0f, -588.0f, false);
+ break;
+ default:
+ break;
+ }
+#endif
+} \ No newline at end of file
diff --git a/src/control/Bridge.h b/src/control/Bridge.h
index dd781a9a..e639d4c1 100644
--- a/src/control/Bridge.h
+++ b/src/control/Bridge.h
@@ -26,4 +26,5 @@ public:
static bool ShouldLightsBeFlashing();
static void FindBridgeEntities();
static bool ThisIsABridgeObjectMovingUp(int);
+ static void ForceBridgeState(uint8 state);
};
diff --git a/src/control/Garages.cpp b/src/control/Garages.cpp
index de536918..db920fed 100644
--- a/src/control/Garages.cpp
+++ b/src/control/Garages.cpp
@@ -1825,7 +1825,7 @@ void CGarage::FindDoorsEntities()
}
}
if (m_pDoor1 && m_pDoor2) {
- if (m_pDoor1->GetModelIndex() != MI_LCS_GARAGEDOOR39 && m_pDoor1->GetModelIndex() != MI_LCS_GARAGEDOOR40) {
+ if (m_pDoor1->GetModelIndex() != MI_CRUSHERBODY && m_pDoor1->GetModelIndex() != MI_CRUSHERLID) {
CVector2D vecDoor1ToGarage(m_pDoor1->GetPosition().x - GetGarageCenterX(), m_pDoor1->GetPosition().y - GetGarageCenterY());
CVector2D vecDoor2ToGarage(m_pDoor2->GetPosition().x - GetGarageCenterX(), m_pDoor2->GetPosition().y - GetGarageCenterY());
if (DotProduct2D(vecDoor1ToGarage, vecDoor2ToGarage) > 0.0f) {
@@ -2409,44 +2409,45 @@ void CGarages::Load(uint8* buf, uint32 size)
bool
CGarages::IsModelIndexADoor(uint32 id)
{
- return id == MI_LCS_GARAGEDOOR01 ||
- id == MI_LCS_GARAGEDOOR02 ||
- id == MI_LCS_GARAGEDOOR03 ||
- id == MI_LCS_GARAGEDOOR04 ||
- id == MI_LCS_GARAGEDOOR05 ||
- id == MI_LCS_GARAGEDOOR06 ||
- id == MI_LCS_GARAGEDOOR07 ||
- id == MI_LCS_GARAGEDOOR08 ||
- id == MI_LCS_GARAGEDOOR09 ||
- id == MI_LCS_GARAGEDOOR10 ||
- id == MI_LCS_GARAGEDOOR11 ||
- id == MI_LCS_GARAGEDOOR12 ||
- id == MI_LCS_GARAGEDOOR13 ||
- id == MI_LCS_GARAGEDOOR14 ||
- id == MI_LCS_GARAGEDOOR15 ||
- id == MI_LCS_GARAGEDOOR16 ||
- id == MI_LCS_GARAGEDOOR17 ||
- id == MI_LCS_GARAGEDOOR18 ||
- id == MI_LCS_GARAGEDOOR19 ||
- id == MI_LCS_GARAGEDOOR20 ||
- id == MI_LCS_GARAGEDOOR21 ||
- id == MI_LCS_GARAGEDOOR22 ||
- id == MI_LCS_GARAGEDOOR23 ||
- id == MI_LCS_GARAGEDOOR24 ||
- id == MI_LCS_GARAGEDOOR25 ||
- id == MI_LCS_GARAGEDOOR26 ||
- id == MI_LCS_GARAGEDOOR27 ||
- id == MI_LCS_GARAGEDOOR28 ||
- id == MI_LCS_GARAGEDOOR29 ||
- id == MI_LCS_GARAGEDOOR30 ||
- id == MI_LCS_GARAGEDOOR31 ||
- id == MI_LCS_GARAGEDOOR32 ||
- id == MI_LCS_GARAGEDOOR33 ||
- id == MI_LCS_GARAGEDOOR34 ||
- id == MI_LCS_GARAGEDOOR35 ||
- id == MI_LCS_GARAGEDOOR36 ||
- id == MI_LCS_GARAGEDOOR37 ||
- id == MI_LCS_GARAGEDOOR38 ||
- id == MI_LCS_GARAGEDOOR39 ||
- id == MI_LCS_GARAGEDOOR40;
+ return id == MI_GARAGEDOOR1 ||
+ id == MI_GARAGEDOOR17 ||
+ id == MI_GARAGEDOOR27 ||
+ id == MI_GARAGEDOOR28 ||
+ id == MI_GARAGEDOOR29 ||
+ id == MI_GARAGEDOOR30 ||
+ id == MI_GARAGEDOOR31 ||
+ id == MI_GARAGEDOOR32 ||
+ id == MI_GARAGEDOOR33 ||
+ id == MI_GARAGEDOOR34 ||
+ id == MI_GARAGEDOOR35 ||
+ id == MI_GARAGEDOOR36 ||
+ id == MI_GARAGEDOOR37 ||
+ id == MI_GARAGEDOOR38 ||
+ id == MI_GARAGEDOOR39 ||
+ id == MI_CRUSHERBODY ||
+ id == MI_CRUSHERLID ||
+ id == MI_GARAGEDOOR2 ||
+ id == MI_GARAGEDOOR3 ||
+ id == MI_GARAGEDOOR4 ||
+ id == MI_GARAGEDOOR5 ||
+ id == MI_GARAGEDOOR6 ||
+ id == MI_GARAGEDOOR7 ||
+ id == MI_GARAGEDOOR9 ||
+ id == MI_GARAGEDOOR10 ||
+ id == MI_GARAGEDOOR11 ||
+ id == MI_GARAGEDOOR12 ||
+ id == MI_GARAGEDOOR13 ||
+ id == MI_GARAGEDOOR14 ||
+ id == MI_GARAGEDOOR15 ||
+ id == MI_GARAGEDOOR16 ||
+ id == MI_GARAGEDOOR18 ||
+ id == MI_GARAGEDOOR19 ||
+ id == MI_GARAGEDOOR20 ||
+ id == MI_GARAGEDOOR21 ||
+ id == MI_GARAGEDOOR22 ||
+ id == MI_GARAGEDOOR23 ||
+ id == MI_GARAGEDOOR24 ||
+ id == MI_GARAGEDOOR25 ||
+ id == MI_GARAGEDOOR26 ||
+ id == MI_DOOR2_SJL;
}