Skip to content

Commit

Permalink
add rough support for getting gameid pre 5.7
Browse files Browse the repository at this point in the history
  • Loading branch information
wsor4035 committed May 25, 2024
1 parent 6bbd97a commit 68fd967
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion src/gameid.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,27 @@ local game_alias = {
mineclone2 = "mineclonia",
}

local gameid = minetest.get_game_info().id
local game_modnames = {
mineclonia = "mcl_core",
farlands_reloaded = "fl_core",
minetest = "default",
hades = "hades_core",
exile = "exile_env_sounds",
ksurvive2 = "ks_metals",
}

local gameid = "xcompat_unknown_gameid"

if type(minetest.get_game_info) == "function" then
gameid = minetest.get_game_info().id
else
for game, modname in pairs(game_modnames) do
if minetest.get_modpath(modname) then
gameid = game
break
end
end
end

--for games that are similar/derviatives of other games
if game_alias[gameid] then gameid = game_alias[gameid] end
Expand Down

0 comments on commit 68fd967

Please sign in to comment.