summaryrefslogtreecommitdiffstats
path: root/src/core/Zones.cpp
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-05-08 15:19:55 +0200
committerGitHub <noreply@github.com>2020-05-08 15:19:55 +0200
commit78ca9124346a965d67a7004c30d1f89d8087c910 (patch)
treed03b15f91313874e29952462f2b01e537c2247ca /src/core/Zones.cpp
parentfix (diff)
parentzone info commands + fix (diff)
downloadre3-78ca9124346a965d67a7004c30d1f89d8087c910.tar
re3-78ca9124346a965d67a7004c30d1f89d8087c910.tar.gz
re3-78ca9124346a965d67a7004c30d1f89d8087c910.tar.bz2
re3-78ca9124346a965d67a7004c30d1f89d8087c910.tar.lz
re3-78ca9124346a965d67a7004c30d1f89d8087c910.tar.xz
re3-78ca9124346a965d67a7004c30d1f89d8087c910.tar.zst
re3-78ca9124346a965d67a7004c30d1f89d8087c910.zip
Diffstat (limited to 'src/core/Zones.cpp')
-rw-r--r--src/core/Zones.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/core/Zones.cpp b/src/core/Zones.cpp
index f511bfc8..c0fa7cbe 100644
--- a/src/core/Zones.cpp
+++ b/src/core/Zones.cpp
@@ -399,6 +399,7 @@ int16
CTheZones::FindNextZoneByLabelAndReturnIndex(char *name, eZoneType type)
{
char str[8];
+ ++FindIndex;
memset(str, 0, 8);
strncpy(str, name, 8);
switch(type){
@@ -501,6 +502,21 @@ CTheZones::SetZoneCarInfo(uint16 zoneid, uint8 day, int16 carDensity,
info->gangThreshold[8] = gangCarDensities[8] + info->gangThreshold[7];
}
+void CTheZones::SetZoneCivilianCarInfo(uint16 zoneid, uint8 day,
+ const int16* carDensities, const int16* boatDensities)
+{
+ CZone* zone;
+ CZoneInfo* info;
+ zone = GetInfoZone(zoneid);
+ info = &ZoneInfoArray[day ? zone->zoneinfoDay : zone->zoneinfoNight];
+ info->carThreshold[0] = carDensities[0];
+ for (int i = 1; i < CCarCtrl::NUM_CAR_CLASSES; i++)
+ info->carThreshold[i] = carDensities[i] + info->carThreshold[i-1];
+ info->boatThreshold[0] = boatDensities[0];
+ for (int i = 1; i < CCarCtrl::NUM_BOAT_CLASSES; i++)
+ info->boatThreshold[i] = boatDensities[i] + info->boatThreshold[i - 1];
+}
+
void
CTheZones::SetZonePedInfo(uint16 zoneid, uint8 day, int16 pedDensity,
int16 gang0Density, int16 gang1Density, int16 gang2Density, int16 gang3Density,