aboutsummaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2019-02-22 03:19:52 +0000
committerParamat <paramat@users.noreply.github.com>2019-02-22 03:19:52 +0000
commit85389ad9949fa3ffca85aa65e577a70547bcd211 (patch)
treef019fc6e6bf2c5dea8bab505aba3ded0991b734f /builtin
parent0ad96cc73f5498cf4ffe85afe1478066acfd377a (diff)
downloadminetest-85389ad9949fa3ffca85aa65e577a70547bcd211.tar.gz
minetest-85389ad9949fa3ffca85aa65e577a70547bcd211.tar.bz2
minetest-85389ad9949fa3ffca85aa65e577a70547bcd211.zip
Content store: Ignore '_game' in game names in ID generation (#8270)
Fixes 'install' button continuing to be displayed after installing a game whose name ends with '_game'.
Diffstat (limited to 'builtin')
-rw-r--r--builtin/mainmenu/dlg_contentstore.lua7
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/mainmenu/dlg_contentstore.lua b/builtin/mainmenu/dlg_contentstore.lua
index a9a9363dc..384bee36c 100644
--- a/builtin/mainmenu/dlg_contentstore.lua
+++ b/builtin/mainmenu/dlg_contentstore.lua
@@ -297,7 +297,12 @@ function store.load()
package.author .. "/" .. package.name ..
"/releases/" .. package.release .. "/download/"
- package.id = package.author .. "/" .. package.name
+ local name_len = #package.name
+ if package.type == "game" and name_len > 5 and package.name:sub(name_len - 4) == "_game" then
+ package.id = package.author .. "/" .. package.name:sub(1, name_len - 5)
+ else
+ package.id = package.author .. "/" .. package.name
+ end
end
store.packages = store.packages_full