Fix the order predicate for GameCommands

This commit bumps the network stream version
This commit is contained in:
Manuel Vögele authored and Michał Janiszewski committed 2018-04-14 22:47:41 +02:00
1 parent 5d85ea1410
commit e4b42f58a5
2 files changed
+9 -2

No files matched your search

+1 -1
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;
+8 -1
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;
}
};