summaryrefslogtreecommitdiffstats
path: root/src/peds/PedType.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2020-03-17 19:03:13 +0100
committereray orçunus <erayorcunus@gmail.com>2020-03-21 12:58:54 +0100
commitd5a6e17079ab87b946132155bbe37bd20e27c239 (patch)
tree87a72ec36821bb04d9c08ed0e5730c2393b8fcf4 /src/peds/PedType.cpp
parentMerge pull request #346 from Sergeanur/Radar2 (diff)
downloadre3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.gz
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.bz2
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.lz
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.xz
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.tar.zst
re3-d5a6e17079ab87b946132155bbe37bd20e27c239.zip
Diffstat (limited to 'src/peds/PedType.cpp')
-rw-r--r--src/peds/PedType.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/peds/PedType.cpp b/src/peds/PedType.cpp
index 3b95109d..4c9d6b3f 100644
--- a/src/peds/PedType.cpp
+++ b/src/peds/PedType.cpp
@@ -63,9 +63,9 @@ CPedType::LoadPedData(void)
line[linelen++] = ' ';
else
line[linelen++] = buf[bp];
- line[linelen] = '\0';
}
bp++;
+ line[linelen] = '\0';
// skip white space
for(lp = 0; line[lp] <= ' '; lp++);
@@ -74,7 +74,7 @@ CPedType::LoadPedData(void)
line[lp] == '#')
continue;
- // FIX: game just uses line here
+ // Game uses just "line" here since sscanf already trims whitespace, but this is safer
sscanf(&line[lp], "%s", word);
if(strncmp(word, "Threat", 7) == 0){
@@ -195,7 +195,8 @@ void
CPedType::Load(uint8 *buf, uint32 size)
{
INITSAVEBUF
- CheckSaveHeader(buf, 'P','T','P','\0', size - SAVE_HEADER_SIZE);
+ // original: SkipSaveBuf(buf, SAVE_HEADER_SIZE);
+ CheckSaveHeader(buf, 'P', 'T', 'P', '\0', size - SAVE_HEADER_SIZE);
for(int i = 0; i < NUM_PEDTYPES; i++)
*ms_apPedType[i] = ReadSaveBuf<CPedType>(buf);