diff options
| author | Xavier ASUS <xavi92psx@gmail.com> | 2018-11-25 18:02:18 +0100 |
|---|---|---|
| committer | Xavier ASUS <xavi92psx@gmail.com> | 2018-11-25 18:02:18 +0100 |
| commit | 64dbf5cdd5c16ab6ccdadcfd66949aba5b8fa1e2 (patch) | |
| tree | d408c06ac5573c35eaee8fd451114fd73acde2f8 /Source/PltParser.c | |
| parent | 135a1e93cb9b3a859c4269a94ababe33b3558f9a (diff) | |
Bugfix: minutes were not being retrieved from PLT files.
Game.c: parking slots cannot be selected if an aircraft in STATE_PARKED state is on it.
Other fixes and improvements.
Added some tiles from TILESET2.TIM
Diffstat (limited to 'Source/PltParser.c')
| -rw-r--r-- | Source/PltParser.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Source/PltParser.c b/Source/PltParser.c index 4d01135..0d97739 100644 --- a/Source/PltParser.c +++ b/Source/PltParser.c @@ -45,8 +45,8 @@ bool PltParserLoadFile(const char* strPath, TYPE_FLIGHT_DATA* const ptrFlightDat char lineBuffer[LINE_MAX_CHARACTERS]; char* lineBufferPtr; char* pltBufferSavePtr; - char strHour[PLT_HOUR_MINUTE_CHARACTERS]; - char strMinutes[PLT_HOUR_MINUTE_CHARACTERS]; + char strHour[PLT_HOUR_MINUTE_CHARACTERS] = {'\0'}; + char strMinutes[PLT_HOUR_MINUTE_CHARACTERS] = {'\0'};; uint8_t* strPltBuffer; if (SystemLoadFile(strPath) == false) @@ -112,7 +112,6 @@ bool PltParserLoadFile(const char* strPath, TYPE_FLIGHT_DATA* const ptrFlightDat if (i == PLT_COLON_POSITION) { j = 0; - buffer = strtok(NULL,"\n"); continue; } else if (i < PLT_COLON_POSITION) @@ -126,17 +125,14 @@ bool PltParserLoadFile(const char* strPath, TYPE_FLIGHT_DATA* const ptrFlightDat } GameSetTime((uint8_t)atoi(strHour),(uint8_t)atoi(strMinutes) ); - Serial_printf("Game time set to %.2d:%.2d.\n",(uint8_t)atoi(strHour),(uint8_t)atoi(strMinutes) ); } else { - typedef enum t_lineType + enum { MESSAGE_INFO, AIRCRAFT_DATA - }TYPE_LINE; - - TYPE_LINE tLine = AIRCRAFT_DATA; // Default value + } tLine = AIRCRAFT_DATA; // Default value TYPE_MESSAGE_DATA tMessage = {0}; // File header (initial game time) has already been read |
