Changeset 29c35a6 in Readingame


Ignore:
Timestamp:
May 1, 2024, 11:38:53 AM (8 weeks ago)
Author:
PulkoMandy <pulkomandy@…>
Branches:
main
Parents:
c52dd7b
Message:

MSGGEN can be empty

This was resulting in an off by one error.

Visite au Zoo is now fully playable.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main.cpp

    rc52dd7b r29c35a6  
    13451345}
    13461346
    1347 void ReadRoomsMessages(BFile& f)
     1347void ReadRoomsMessages(BFile& f, int& roomNumber)
    13481348{
    1349         static int roomNumber = 0;
    1350 
    13511349        off_t fileSize;
    13521350        f.GetSize(&fileSize);
     
    14661464        ReadRoomsScripts(condUltiFile);
    14671465
    1468         ReadRoomsMessages(msgGeneralFile);
    1469         ReadRoomsMessages(msgRoomsFile);
     1466        int roomNumber = 0;
     1467        ReadRoomsMessages(msgGeneralFile, roomNumber);
     1468
     1469        if (roomNumber > 1) {
     1470                printf("WARNING: more than 1 room in MSGGEN\n");
     1471        }
     1472
     1473        if (roomNumber == 0) {
     1474                // No MSGGEN, but leave an empty slot for it so that room numbers are not offset.
     1475                roomNumber++;
     1476        }
     1477
     1478        ReadRoomsMessages(msgRoomsFile, roomNumber);
    14701479
    14711480        // TODO how many variables are there?
Note: See TracChangeset for help on using the changeset viewer.