summaryrefslogtreecommitdiffstats
path: root/src/control/CarGen.cpp
diff options
context:
space:
mode:
authorNikolay Korolev <nickvnuk@gmail.com>2019-07-28 11:57:25 +0200
committerNikolay Korolev <nickvnuk@gmail.com>2019-07-28 11:57:25 +0200
commit6ff6305be946918697b98100020417cdf2406f52 (patch)
treef2adc2a760c404fe353bc36d9f8fa25b5df0c07f /src/control/CarGen.cpp
parentMerge remote-tracking branch 'upstream/master' (diff)
downloadre3-6ff6305be946918697b98100020417cdf2406f52.tar
re3-6ff6305be946918697b98100020417cdf2406f52.tar.gz
re3-6ff6305be946918697b98100020417cdf2406f52.tar.bz2
re3-6ff6305be946918697b98100020417cdf2406f52.tar.lz
re3-6ff6305be946918697b98100020417cdf2406f52.tar.xz
re3-6ff6305be946918697b98100020417cdf2406f52.tar.zst
re3-6ff6305be946918697b98100020417cdf2406f52.zip
Diffstat (limited to 'src/control/CarGen.cpp')
-rw-r--r--src/control/CarGen.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/control/CarGen.cpp b/src/control/CarGen.cpp
index 332ff16d..876ba1ae 100644
--- a/src/control/CarGen.cpp
+++ b/src/control/CarGen.cpp
@@ -283,18 +283,18 @@ void CTheCarGenerators::SaveAllCarGenerators(uint8 *buffer, uint32 *size)
void CTheCarGenerators::LoadAllCarGenerators(uint8* buffer, uint32 size)
{
Init();
- assert(size == 8 + NUM_CARGENS * 72);
+ assert(size == 28 + NUM_CARGENS * 72);
assert(buffer[0] == 'C');
assert(buffer[1] == 'G');
assert(buffer[2] == 'N');
assert(buffer[3] == '\0');
assert(*(uint32*)(buffer + 4) == size - 8);
- buffer += 8;
NumOfCarGenerators = *(uint32*)(buffer + 12);
CurrentActiveCount = *(uint32*)(buffer + 16);
ProcessCounter = *(uint8*)(buffer + 20);
GenerateEvenIfPlayerIsCloseCounter = *(uint8*)(buffer + 21);
assert(*(uint32*)(buffer + 24) == 72 * NUM_CARGENS);
+ buffer += 28;
for (int i = 0; i < NUM_CARGENS; i++) {
CarGeneratorArray[i].Load(buffer);
buffer += 72;