From 8e1405a023df9e3f16cebdfbe8c9d342404859de Mon Sep 17 00:00:00 2001 From: Tim Felgentreff <timfelgentreff@gmail.com> Date: Thu, 3 Mar 2022 22:43:07 +0100 Subject: [PATCH] fix team assignments again --- src/game/replay.cpp | 3 ++- src/include/settings.h | 6 +++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/game/replay.cpp b/src/game/replay.cpp index e65b3afb1..44ee52489 100644 --- a/src/game/replay.cpp +++ b/src/game/replay.cpp @@ -163,6 +163,8 @@ static FullReplay *StartReplay() replay->Comment1 = "Generated by Stratagus Version " VERSION ""; replay->Comment2 = "Visit " HOMEPAGE " for more information"; + replay->ReplaySettings = GameSettings; + for (int i = 0; i < PlayerMax; ++i) { replay->PlayerNames[i] = Players[i].Name; replay->ReplaySettings.Presets[i].PlayerColor = GameSettings.Presets[i].PlayerColor; @@ -178,7 +180,6 @@ static FullReplay *StartReplay() replay->Map = Map.Info.Description; replay->MapId = (signed int)Map.Info.MapUID; replay->MapPath = CurrentMapPath; - replay->ReplaySettings = GameSettings; replay->Engine[0] = StratagusMajorVersion; replay->Engine[1] = StratagusMinorVersion; diff --git a/src/include/settings.h b/src/include/settings.h index bcf539e06..b74f77030 100644 --- a/src/include/settings.h +++ b/src/include/settings.h @@ -113,10 +113,10 @@ static_assert(MAX_RACES < 256, "Race selection needs to fit into 8 bits"); static_assert(PlayerMax < 256, "Team number must fit into 8 bits"); struct SettingsPresets { - uint8_t PlayerColor; /// Color of a player + int8_t PlayerColor; /// Color of a player std::string AIScript; /// AI script for computer to use - uint8_t Race; /// Race of the player - uint8_t Team; /// Team of player + int8_t Race; /// Race of the player + int8_t Team; /// Team of player PlayerTypes Type; /// Type of player (for network games) void Save(const std::function <void (std::string)>& f) {