From ad8b0892e79dab9ef877ea96314b0d4598b24582 Mon Sep 17 00:00:00 2001 From: Artur Iwicki Date: Oct 07 2019 15:54:09 +0000 Subject: Fix the game crashing when running under certain locale settings --- diff --git a/colobot--do-not-translate-default-player-name.patch b/colobot--do-not-translate-default-player-name.patch new file mode 100644 index 0000000..0c67a99 --- /dev/null +++ b/colobot--do-not-translate-default-player-name.patch @@ -0,0 +1,13 @@ +diff --git a/src/level/player_profile.cpp b/src/level/player_profile.cpp +index 9abd20a8..c342cdae 100644 +--- a/src/level/player_profile.cpp ++++ b/src/level/player_profile.cpp +@@ -134,7 +134,7 @@ std::string CPlayerProfile::GetLastName() + std::string name; + + if(!GetConfigFile().GetStringProperty("Gamer", "LastName", name) || name.empty()) +- GetResource(RES_TEXT, RT_NAME_DEFAULT, name); ++ name = "Player"; + + return name; + } diff --git a/colobot.spec b/colobot.spec index 54ce5a4..10a58e9 100644 --- a/colobot.spec +++ b/colobot.spec @@ -1,6 +1,6 @@ Name: colobot Version: 0.1.12 -Release: 3%{?dist} +Release: 4%{?dist} Summary: A video game that teaches programming in a fun way License: GPLv3 @@ -38,6 +38,14 @@ Source119: %{musicurl}/Proton.ogg Source120: %{musicurl}/Prototype.ogg +# The game uses the translated string "Player" as the default player name +# yet it does not properly handle UTF-8 in player names, +# so non-English speakers may have the game always crash when putting in the player name. +# +# See: https://github.com/colobot/colobot/issues/1268 +Patch0: colobot--do-not-translate-default-player-name.patch + + BuildRequires: boost-devel >= 1.51 BuildRequires: boost-filesystem >= 1.51 BuildRequires: boost-regex >= 1.51 @@ -89,6 +97,7 @@ Music files used by Colobot Gold. %prep %setup -q -n colobot-%{gittag} +%patch0 -p1 rm -rf ./data cp %{SOURCE1} ./data.tgz @@ -171,6 +180,10 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/*.appdata %changelog +* Mon Oct 07 2019 Artur Iwicki - 0.1.12-4 +- Make the game always use "Player" as the default player name + (fixes the game crashing under certain system locale settings) + * Wed Jul 24 2019 Fedora Release Engineering - 0.1.12-3 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild