diff options
author | B. Watson <yalhcru@gmail.com> | 2021-10-17 17:10:53 -0400 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2021-10-29 17:07:15 +0700 |
commit | 5eb6ce46c5980e63f9888af21be1abe18714d75e (patch) | |
tree | 1aae1285f24c6b5ccda68a88344011c84e545c52 /games/ufoai/patches | |
parent | 7ad090fd48be0c12e4ea59a4e92c1f6f13286a0d (diff) |
games/ufoai: Fix -current build.
Signed-off-by: B. Watson <yalhcru@gmail.com>
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'games/ufoai/patches')
-rw-r--r-- | games/ufoai/patches/bug-949301-mxml.patch | 29 | ||||
-rw-r--r-- | games/ufoai/patches/initialize-entityString.patch | 26 | ||||
-rw-r--r-- | games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch | 36 | ||||
-rw-r--r-- | games/ufoai/patches/series | 3 |
4 files changed, 94 insertions, 0 deletions
diff --git a/games/ufoai/patches/bug-949301-mxml.patch b/games/ufoai/patches/bug-949301-mxml.patch new file mode 100644 index 0000000000000..678a0b8e3bee3 --- /dev/null +++ b/games/ufoai/patches/bug-949301-mxml.patch @@ -0,0 +1,29 @@ +From: Markus Koschany <apo@debian.org> +Date: Mon, 17 Feb 2020 22:49:06 +0100 +Subject: bug 949301 mxml + +Bug-Debian: https://bugs.debian.org/949301 +Origin: https://sourceforge.net/p/ufoai/code/ci/163073ab9527cdaa33d77a713b8e46ff462a2b5c/ +--- + src/common/xml.cpp | 7 ++++++- + 1 file changed, 6 insertions(+), 1 deletion(-) + +diff --git a/src/common/xml.cpp b/src/common/xml.cpp +index 1629c90..8323752 100644 +--- a/src/common/xml.cpp ++++ b/src/common/xml.cpp +@@ -519,8 +519,13 @@ static mxml_type_t mxml_ufo_type_cb (xmlNode_t* node) + /* You can lookup attributes and/or use the + * element name, hierarchy, etc... */ + const char* type = mxmlElementGetAttr(node, "type"); +- if (type == nullptr) ++ if (type == nullptr) { ++#ifdef MXML_MAJOR_VERSION ++ type = mxmlGetElement(node); ++#else + type = node->value.element.name; ++#endif ++ } + + if (!strcmp(type, "int")) + return MXML_INTEGER; diff --git a/games/ufoai/patches/initialize-entityString.patch b/games/ufoai/patches/initialize-entityString.patch new file mode 100644 index 0000000000000..cdbf9e52bd96a --- /dev/null +++ b/games/ufoai/patches/initialize-entityString.patch @@ -0,0 +1,26 @@ +From: Markus Koschany <apo@debian.org> +Date: Tue, 25 Apr 2017 14:31:16 +0200 +Subject: initialize entityString + +Initialize entityString to avoid that ufo2map will randomly segfault when +compiling the maps. + +Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=860680 +Forwarded: https://sourceforge.net/p/ufoai/code/ci/bae827ba025ff1d3a56b402c27aa84401914acc4/ +--- + src/tools/ufo2map/map.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/tools/ufo2map/map.cpp b/src/tools/ufo2map/map.cpp +index 47c49f3..f56c55e 100644 +--- a/src/tools/ufo2map/map.cpp ++++ b/src/tools/ufo2map/map.cpp +@@ -1227,7 +1227,7 @@ void LoadMapFile (const char* filename) + /* Set the number of tiles to 1. This is fix for ufo2map right now. */ + mapTiles.numTiles = 1; + +- char entityString[MAX_TOKEN_CHARS]; ++ char entityString[MAX_TOKEN_CHARS] = ""; + const char* ump = GetUMPName(filename); + if (ump != nullptr) + ParseUMP(ump, entityString, false); diff --git a/games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch b/games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch new file mode 100644 index 0000000000000..d8575fe169dce --- /dev/null +++ b/games/ufoai/patches/segfault-reactionfire-mode-bug-861979.patch @@ -0,0 +1,36 @@ +From: Markus Koschany <apo@debian.org> +Date: Sun, 7 May 2017 18:46:50 +0200 +Subject: segfault reactionfire mode bug 861979 + +Forwarded: http://ufoai.org/forum/index.php/topic,9111.0.html +Origin: https://sourceforge.net/p/ufoai/code/ci/9cad041f0931b1f49e0c70f32e351a7227f0d2ff/ +--- + src/game/inv_shared.cpp | 7 ++----- + 1 file changed, 2 insertions(+), 5 deletions(-) + +diff --git a/src/game/inv_shared.cpp b/src/game/inv_shared.cpp +index 708e708..e5a73a5 100644 +--- a/src/game/inv_shared.cpp ++++ b/src/game/inv_shared.cpp +@@ -633,9 +633,6 @@ const fireDef_t* Item::getSlowestFireDef () const + */ + const objDef_t* Item::getReactionFireWeaponType () const + { +- if (!this) +- return nullptr; +- + if (def()) { + const fireDef_t* fd = getFiredefs(); + if (fd && fd->reaction) +@@ -999,9 +996,9 @@ Item* Inventory::findInContainer (const containerIndex_t contId, const Item* con + */ + bool Inventory::holdsReactionFireWeapon () const + { +- if (getRightHandContainer()->getReactionFireWeaponType()) ++ if (getRightHandContainer() != nullptr && getRightHandContainer()->getReactionFireWeaponType()) + return true; +- if (getLeftHandContainer()->getReactionFireWeaponType()) ++ if (getLeftHandContainer() != nullptr && getLeftHandContainer()->getReactionFireWeaponType()) + return true; + return false; + } diff --git a/games/ufoai/patches/series b/games/ufoai/patches/series new file mode 100644 index 0000000000000..345b9b459ea06 --- /dev/null +++ b/games/ufoai/patches/series @@ -0,0 +1,3 @@ +initialize-entityString.patch +segfault-reactionfire-mode-bug-861979.patch +bug-949301-mxml.patch |