summaryrefslogtreecommitdiffstats
path: root/src/control
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2020-05-07 22:22:15 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2020-05-07 22:22:15 +0200
commitb99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04 (patch)
treeab07a4b632108268d62700baf702536c1e87b4f9 /src/control
parentintermediate changes (diff)
parentCBaseModelInfo done (diff)
downloadre3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.gz
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.bz2
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.lz
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.xz
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.tar.zst
re3-b99346e6ca8bd6ee8d8d6b7cf1b21b9d06b0ab04.zip
Diffstat (limited to 'src/control')
-rw-r--r--src/control/CarCtrl.cpp1
-rw-r--r--src/control/CarCtrl.h4
-rw-r--r--src/control/Script.cpp16
3 files changed, 13 insertions, 8 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp
index 66a41fcb..808a3769 100644
--- a/src/control/CarCtrl.cpp
+++ b/src/control/CarCtrl.cpp
@@ -711,6 +711,7 @@ CCarCtrl::ChooseGangCarModel(int32 gang)
void
CCarCtrl::AddToCarArray(int32 id, int32 vehclass)
{
+ assert(TotalNumOfCarsOfRating[vehclass] < MAX_CAR_MODELS_IN_ARRAY);
CarArrays[vehclass][TotalNumOfCarsOfRating[vehclass]++] = id;
}
diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h
index f71fc26f..9f5deebe 100644
--- a/src/control/CarCtrl.h
+++ b/src/control/CarCtrl.h
@@ -12,7 +12,7 @@ class CZoneInfo;
enum{
MAX_CARS_TO_KEEP = 2,
- MAX_CAR_MODELS_IN_ARRAY = 256,
+ MAX_CAR_MODELS_IN_ARRAY = 25,
};
#define LANE_WIDTH 5.0f
@@ -34,8 +34,10 @@ public:
TAXI,
MOPED,
MOTORBIKE,
+
LEISUREBOAT,
WORKERBOAT,
+
COPS,
MAFIA,
TRIAD,
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 58222317..49da30b0 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -3089,18 +3089,20 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
case COMMAND_SET_ZONE_CAR_INFO:
{
char label[12];
+ int16 gangDensities[NUM_GANGS];
+ int i;
+
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
m_nIp += KEY_LENGTH_IN_SCRIPT;
- CollectParameters(&m_nIp, 16);
+ CollectParameters(&m_nIp, 12);
int zone = CTheZones::FindZoneByLabelAndReturnIndex(label, ZONE_INFO);
if (zone < 0) {
debug("Couldn't find zone - %s\n", label);
return 0;
}
- CTheZones::SetZoneCarInfo(zone, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3],
- ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7], ScriptParams[8], 0, 0,
- ScriptParams[9], ScriptParams[10], ScriptParams[11], ScriptParams[12],
- ScriptParams[13], ScriptParams[14], ScriptParams[15]);
+ for(i = 0; i < NUM_GANGS; i++)
+ gangDensities[i] = ScriptParams[2+i];
+ CTheZones::SetZoneCarInfo(zone, ScriptParams[0], ScriptParams[1], ScriptParams[11], gangDensities);
return 0;
}
/* Not implemented.
@@ -3158,14 +3160,14 @@ int8 CRunningScript::ProcessCommands300To399(int32 command)
char label[12];
CTheScripts::ReadTextLabelFromScript(&m_nIp, label);
m_nIp += KEY_LENGTH_IN_SCRIPT;
- CollectParameters(&m_nIp, 10);
+ CollectParameters(&m_nIp, 12);
int16 zone = CTheZones::FindZoneByLabelAndReturnIndex(label, ZONE_INFO);
if (zone < 0) {
debug("Couldn't find zone - %s\n", label);
return 0;
}
CTheZones::SetZonePedInfo(zone, ScriptParams[0], ScriptParams[1], ScriptParams[2], ScriptParams[3],
- ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7], ScriptParams[8], 0, 0, ScriptParams[9]);
+ ScriptParams[4], ScriptParams[5], ScriptParams[6], ScriptParams[7], ScriptParams[8], ScriptParams[9], ScriptParams[10], ScriptParams[11]);
return 0;
}
case COMMAND_SET_TIME_SCALE: