diff options
author | aap <aap@papnet.eu> | 2020-08-20 23:01:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-20 23:01:21 +0200 |
commit | 857cef776d578d4cf7364b044977d9ed546918a3 (patch) | |
tree | 5fccc3f14dc6730f1d7abbdfb2f55c22bb5925b0 /src/control | |
parent | fixed sound enum (diff) | |
parent | stable CScriptPaths (diff) | |
download | re3-857cef776d578d4cf7364b044977d9ed546918a3.tar re3-857cef776d578d4cf7364b044977d9ed546918a3.tar.gz re3-857cef776d578d4cf7364b044977d9ed546918a3.tar.bz2 re3-857cef776d578d4cf7364b044977d9ed546918a3.tar.lz re3-857cef776d578d4cf7364b044977d9ed546918a3.tar.xz re3-857cef776d578d4cf7364b044977d9ed546918a3.tar.zst re3-857cef776d578d4cf7364b044977d9ed546918a3.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/Replay.cpp | 5 | ||||
-rw-r--r-- | src/control/Script.cpp | 23 |
2 files changed, 19 insertions, 9 deletions
diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 1a050bee..80c05f31 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -39,6 +39,7 @@ #include "Text.h" #include "Camera.h" #include "Radar.h" +#include "Fluff.h" uint8 CReplay::Mode; CAddressInReplayBuffer CReplay::Record; @@ -229,7 +230,7 @@ void CReplay::EnableReplays(void) void PlayReplayFromHD(void); void CReplay::Update(void) { - if (CCutsceneMgr::IsCutsceneProcessing() || CTimer::GetIsPaused()) + if (CCutsceneMgr::IsCutsceneProcessing() || CTimer::GetIsPaused() || CScriptPaths::IsOneActive()) return; switch (Mode){ case MODE_RECORD: @@ -1175,6 +1176,7 @@ void CReplay::StoreStuffInMem(void) if (ped) StoreDetailedPedAnimation(ped, &pPedAnims[i]); } + CScriptPaths::Save_ForReplay(); } void CReplay::RestoreStuffFromMem(void) @@ -1351,6 +1353,7 @@ void CReplay::RestoreStuffFromMem(void) } delete[] pPedAnims; pPedAnims = nil; + CScriptPaths::Load_ForReplay(); DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND); DMAudio.SetRadioInCar(OldRadioStation); DMAudio.ChangeMusicMode(MUSICMODE_GAME); diff --git a/src/control/Script.cpp b/src/control/Script.cpp index fabc375b..fb95e834 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -82,6 +82,7 @@ #include "main.h" #include "Ropes.h" #include "MBlur.h" +#include "Fluff.h" #ifdef USE_ADVANCED_SCRIPT_DEBUG_OUTPUT #include <stdarg.h> #endif @@ -12057,36 +12058,42 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command) //case COMMAND_IS_PLAYER_STANDING_ON_A_VEHICLE: //case COMMAND_IS_PLAYER_FOOT_DOWN: //case COMMAND_IS_CHAR_FOOT_DOWN: - case COMMAND_INITIALISE_OBJECT_PATH: - // TODO(MIAMI): script path + case COMMAND_INITIALISE_OBJECT_PATH: { CollectParameters(&m_nIp, 2); - debug("INITALISE_OBJECT_PATH not yet implemented, skipping\n"); - ScriptParams[0] = 0; + int32 counter = 0; + while (counter < 3 && CScriptPaths::aArray[counter].m_state != SCRIPT_PATH_DISABLED) { + counter++; + } + CScriptPaths::aArray[counter].InitialiseOne(ScriptParams[0], *(float*)&ScriptParams[1]); + ScriptParams[0] = counter; StoreParameters(&m_nIp, 1); return 0; + } case COMMAND_START_OBJECT_ON_PATH: { CollectParameters(&m_nIp, 2); - debug("START_OBJECT_ON_PATH not yet implemented, skipping\n"); + CObject *pObj = CPools::GetObjectPool()->GetAt(ScriptParams[0]); + assert(pObj); + CScriptPaths::aArray[ScriptParams[1]].SetObjectToControl(pObj); return 0; } case COMMAND_SET_OBJECT_PATH_SPEED: { CollectParameters(&m_nIp, 2); - debug("SET_OBJECT_PATH_SPEED not yet implemented, skipping\n"); + CScriptPaths::aArray[ScriptParams[0]].m_fSpeed = *(float*)&ScriptParams[1]; return 0; } case COMMAND_SET_OBJECT_PATH_POSITION: { CollectParameters(&m_nIp, 2); - debug("SET_OBJECT_PATH_POSITION not yet implemented, skipping\n"); + CScriptPaths::aArray[ScriptParams[0]].m_fPosition = *(float*)&ScriptParams[1]; return 0; } //case COMMAND_GET_OBJECT_DISTANCE_ALONG_PATH: case COMMAND_CLEAR_OBJECT_PATH: { CollectParameters(&m_nIp, 1); - debug("CLEAR_OBJECT_PATH not yet implemented, skipping\n"); + CScriptPaths::aArray[ScriptParams[0]].Clear(); return 0; } case COMMAND_HELI_GOTO_COORDS: |