From e4b42f58a5a076adcc4eebce005989c9dcaa9ec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20V=C3=B6gele?= Date: Fri, 13 Apr 2018 12:52:30 +0200 Subject: [PATCH] Fix the order predicate for GameCommands This commit bumps the network stream version --- src/openrct2/network/Network.cpp | 2 +- src/openrct2/network/network.h | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/openrct2/network/Network.cpp b/src/openrct2/network/Network.cpp index 4130449415..cc8618ed34 100644 --- a/src/openrct2/network/Network.cpp +++ b/src/openrct2/network/Network.cpp @@ -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; diff --git a/src/openrct2/network/network.h b/src/openrct2/network/network.h index bb10a743cd..271df19d1c 100644 --- a/src/openrct2/network/network.h +++ b/src/openrct2/network/network.h @@ -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; } };