summaryrefslogtreecommitdiffstats
path: root/src/control/Script.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-10 16:54:13 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-10 16:54:13 +0200
commit00cdcef36aadf363bd216fb38281f18b072b19eb (patch)
tree3fc9855538dd26f4e6f213dc5cc2a49855fa03ec /src/control/Script.cpp
parentMerge remote-tracking branch 'upstream/miami' into miami (diff)
downloadre3-00cdcef36aadf363bd216fb38281f18b072b19eb.tar
re3-00cdcef36aadf363bd216fb38281f18b072b19eb.tar.gz
re3-00cdcef36aadf363bd216fb38281f18b072b19eb.tar.bz2
re3-00cdcef36aadf363bd216fb38281f18b072b19eb.tar.lz
re3-00cdcef36aadf363bd216fb38281f18b072b19eb.tar.xz
re3-00cdcef36aadf363bd216fb38281f18b072b19eb.tar.zst
re3-00cdcef36aadf363bd216fb38281f18b072b19eb.zip
Diffstat (limited to 'src/control/Script.cpp')
-rw-r--r--src/control/Script.cpp62
1 files changed, 23 insertions, 39 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 938a1c25..10dcda90 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -474,7 +474,6 @@ bool CStuckCarCheck::HasCarBeenStuckForAWhile(int32 id)
void CRunningScript::CollectParameters(uint32* pIp, int16 total)
{
for (int16 i = 0; i < total; i++){
- //float tmp;
uint16 varIndex;
switch (CTheScripts::Read1ByteFromScript(pIp))
{
@@ -498,10 +497,6 @@ void CRunningScript::CollectParameters(uint32* pIp, int16 total)
case ARGUMENT_INT16:
ScriptParams[i] = CTheScripts::Read2BytesFromScript(pIp);
break;
- //case ARGUMENT_FLOAT:
- // tmp = CTheScripts::ReadFloatFromScript(pIp);
- // ScriptParams[i] = *(int32*)&tmp;
- break;
default:
assert(0);
break;
@@ -4674,51 +4669,34 @@ int8 CRunningScript::ProcessCommands500To599(int32 command)
}
case COMMAND_SET_GARAGE:
{
- CollectParameters(&m_nIp, 7);
+ CollectParameters(&m_nIp, 9);
float infX = *(float*)&ScriptParams[0];
float infY = *(float*)&ScriptParams[1];
float infZ = *(float*)&ScriptParams[2];
- float supX = *(float*)&ScriptParams[3];
- float supY = *(float*)&ScriptParams[4];
- float supZ = *(float*)&ScriptParams[5];
- if (infX > supX) {
- infX = *(float*)&ScriptParams[3];
- supX = *(float*)&ScriptParams[0];
- }
- if (infY > supY) {
- infY = *(float*)&ScriptParams[4];
- supY = *(float*)&ScriptParams[1];
- }
- if (infZ > supZ) {
- infZ = *(float*)&ScriptParams[5];
- supZ = *(float*)&ScriptParams[2];
- }
- ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, (eGarageType)ScriptParams[6], 0);
+ float X2 = *(float*)&ScriptParams[3];
+ float Y2 = *(float*)&ScriptParams[4];
+ float supX = *(float*)&ScriptParams[5];
+ float supY = *(float*)&ScriptParams[6];
+ float supZ = *(float*)&ScriptParams[7];
+
+ // TODO(MIAMI): new 2 parameters, requires CGarage change
+ ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, X2, Y2, supX, supY, supZ, (eGarageType)ScriptParams[8], 0);
StoreParameters(&m_nIp, 1);
return 0;
}
case COMMAND_SET_GARAGE_WITH_CAR_MODEL:
{
- CollectParameters(&m_nIp, 8);
+ CollectParameters(&m_nIp, 10);
float infX = *(float*)&ScriptParams[0];
float infY = *(float*)&ScriptParams[1];
float infZ = *(float*)&ScriptParams[2];
- float supX = *(float*)&ScriptParams[3];
- float supY = *(float*)&ScriptParams[4];
- float supZ = *(float*)&ScriptParams[5];
- if (infX > supX) {
- infX = *(float*)&ScriptParams[3];
- supX = *(float*)&ScriptParams[0];
- }
- if (infY > supY) {
- infY = *(float*)&ScriptParams[4];
- supY = *(float*)&ScriptParams[1];
- }
- if (infZ > supZ) {
- infZ = *(float*)&ScriptParams[5];
- supZ = *(float*)&ScriptParams[2];
- }
- ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, supX, supY, supZ, (eGarageType)ScriptParams[6], ScriptParams[7]);
+ float X2 = *(float*)&ScriptParams[3];
+ float Y2 = *(float*)&ScriptParams[4];
+ float supX = *(float*)&ScriptParams[5];
+ float supY = *(float*)&ScriptParams[6];
+ float supZ = *(float*)&ScriptParams[7];
+ // TODO(MIAMI): new 2 parameters, requires CGarage change
+ ScriptParams[0] = CGarages::AddOne(infX, infY, infZ, X2, Y2, supX, supY, supZ, (eGarageType)ScriptParams[8], ScriptParams[9]);
StoreParameters(&m_nIp, 1);
return 0;
}
@@ -9791,7 +9769,13 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command)
case COMMAND_GET_CHAR_WEAPON_IN_SLOT:
case COMMAND_GET_CLOSEST_STRAIGHT_ROAD:
case COMMAND_SET_CAR_FORWARD_SPEED:
+ assert(0);
case COMMAND_SET_AREA_VISIBLE:
+ CollectParameters(&m_nIp, 1);
+ CGame::currArea = ScriptParams[0];
+ // TODO(MIAMI) !!
+ //CStreaming::RemoveBuildingsNotInArea(ScriptParams[0]);
+ return 0;
case COMMAND_SET_CUTSCENE_ANIM_TO_LOOP:
assert(0);
case COMMAND_MARK_CAR_AS_CONVOY_CAR: