1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2025-12-10 09:32:29 +01:00

Fix the order predicate for GameCommands

This commit bumps the network stream version
This commit is contained in:
Manuel Vögele
2018-04-13 12:52:30 +02:00
committed by Michał Janiszewski
parent 5d85ea1410
commit e4b42f58a5
2 changed files with 9 additions and 2 deletions

View File

@@ -34,7 +34,7 @@
// This string specifies which version of network stream current build uses.
// It is used for making sure only compatible builds get connected, even within
// single OpenRCT2 version.
#define NETWORK_STREAM_VERSION "4"
#define NETWORK_STREAM_VERSION "5"
#define NETWORK_STREAM_ID OPENRCT2_VERSION "-" NETWORK_STREAM_VERSION
static rct_peep* _pickup_peep = nullptr;

View File

@@ -217,7 +217,14 @@ private:
uint8 callback = 0;
uint32 commandIndex = 0;
bool operator<(const GameCommand& comp) const {
return tick < comp.tick && commandIndex < comp.commandIndex;
// First sort by tick
if (tick < comp.tick)
return true;
if (tick > comp.tick)
return false;
// If the ticks are equal sort by commandIndex
return commandIndex < comp.commandIndex;
}
};