summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-08-24 20:52:16 +0200
committerSergeanur <s.anureev@yandex.ua>2020-08-24 20:52:16 +0200
commitbbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f (patch)
tree4d73bdb6237ce683c25354ebae4c3a093cd7f20c /src/control
parentfixes to zones and vehicle comp rules (diff)
downloadre3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.tar
re3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.tar.gz
re3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.tar.bz2
re3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.tar.lz
re3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.tar.xz
re3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.tar.zst
re3-bbcf3fd7d2e699b0fb7e2cceda8e002dfa61ab3f.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp4
-rw-r--r--src/control/Script.cpp12
2 files changed, 11 insertions, 5 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 5b2454ac..74c4f006 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -2759,7 +2759,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
float steer = difference > 0.0f ? 0.04f : -0.04f;
if (Abs(difference) < 0.2f)
steer *= 5.0f * Abs(difference);
- pPlane->m_fPlaneSteer *= Pow(0.96, CTimer::GetTimeStep());
+ pPlane->m_fPlaneSteer *= Pow(0.96f, CTimer::GetTimeStep());
float steerChange = steer - pPlane->m_fPlaneSteer;
float maxChange = 0.003f * CTimer::GetTimeStep();
if (Abs(steerChange) < maxChange)
@@ -2782,7 +2782,7 @@ void CCarCtrl::SteerAIPlaneTowardsTargetCoors(CAutomobile* pPlane)
pPlane->GetMatrix().GetRight() = right;
pPlane->GetMatrix().GetForward() = forward;
pPlane->GetMatrix().GetUp() = up;
- float newSplit = 1.0f - Pow(0.95, CTimer::GetTimeStep());
+ float newSplit = 1.0f - Pow(0.95f, CTimer::GetTimeStep());
float oldSplit = 1.0f - newSplit;
#ifdef FIX_BUGS
pPlane->m_vecMoveSpeed = pPlane->m_vecMoveSpeed * oldSplit + pPlane->AutoPilot.GetCruiseSpeed() * 0.01f * forward * newSplit;
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index ea94794b..bf761a3f 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -13017,14 +13017,20 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command)
case COMMAND_ATTACH_CUTSCENE_OBJECT_TO_BONE:
{
CollectParameters(&m_nIp, 3);
- debug("ATTACH_CUTSCENE_OBJECT_TO_BONE not implemented, skipping\n"); // TODO(MIAMI)
+ CCutsceneMgr::AttachObjectToBone(CPools::GetObjectPool()->GetAt(ScriptParams[0]), CPools::GetObjectPool()->GetAt(ScriptParams[1]), ScriptParams[2]);
return 0;
}
case COMMAND_ATTACH_CUTSCENE_OBJECT_TO_COMPONENT:
{
CollectParameters(&m_nIp, 2);
- debug("ATTACH_CUTSCENE_OBJECT_TO_COMPONENT not implemented, skipping\n"); // TODO(MIAMI)
+ CObject *obj1 = CPools::GetObjectPool()->GetAt(ScriptParams[0]);
+ CObject *obj2 = CPools::GetObjectPool()->GetAt(ScriptParams[1]);
+
+ char key[KEY_LENGTH_IN_SCRIPT];
+ CTheScripts::ReadTextLabelFromScript(&m_nIp, key);
m_nIp += KEY_LENGTH_IN_SCRIPT;
+
+ CCutsceneMgr::AttachObjectToFrame(obj1, obj2, key);
return 0;
}
case COMMAND_SET_CHAR_STAY_IN_CAR_WHEN_JACKED:
@@ -13236,7 +13242,7 @@ int8 CRunningScript::ProcessCommands1300To1399(int32 command)
case COMMAND_ATTACH_CUTSCENE_OBJECT_TO_VEHICLE:
{
CollectParameters(&m_nIp, 2);
- debug("ATTACH_CUTSCENE_OBJECT_TO_VEHICLE not implemented\n"); // TODO(MIAMI)
+ CCutsceneMgr::AttachObjectToParent(CPools::GetObjectPool()->GetAt(ScriptParams[0]), CPools::GetVehiclePool()->GetAt(ScriptParams[1]));
return 0;
}
case COMMAND_LOAD_MISSION_TEXT: