diff options
Diffstat (limited to 'src/peds/PedType.cpp')
-rw-r--r-- | src/peds/PedType.cpp | 7 |
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); |