Unify detecting old version of MT.
This commit is contained in:
parent
9951114b7f
commit
3bef72b665
@ -1,10 +1,12 @@
|
||||
-- LUALOCALS < ---------------------------------------------------------
|
||||
local ItemStack, ipairs, math, minetest, nodecore, pairs, type
|
||||
= ItemStack, ipairs, math, minetest, nodecore, pairs, type
|
||||
local ItemStack, ipairs, math, minetest, nodecore, pairs, string, type
|
||||
= ItemStack, ipairs, math, minetest, nodecore, pairs, string, type
|
||||
local math_random
|
||||
= math.random
|
||||
-- LUALOCALS > ---------------------------------------------------------
|
||||
|
||||
nodecore.mt_old = minetest.get_version().string:sub(1, 2) == "0."
|
||||
|
||||
for k, v in pairs(minetest) do
|
||||
if type(v) == "function" then
|
||||
-- Late-bind in case minetest methods overridden.
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- LUALOCALS < ---------------------------------------------------------
|
||||
local math, minetest, nodecore, pairs, string, table
|
||||
= math, minetest, nodecore, pairs, string, table
|
||||
local math, minetest, nodecore, pairs, table
|
||||
= math, minetest, nodecore, pairs, table
|
||||
local math_floor, table_concat
|
||||
= math.floor, table.concat
|
||||
-- LUALOCALS > ---------------------------------------------------------
|
||||
@ -73,11 +73,10 @@ local function updatevisuals(player)
|
||||
end
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
local isold = minetest.get_version().string:sub(1, 2) == "0."
|
||||
player:set_properties({
|
||||
visual = "mesh",
|
||||
visual_size = {x = 0.9, y = 0.9, z = 0.9},
|
||||
mesh = modname .. (isold and "_old" or "") .. ".b3d"
|
||||
mesh = modname .. (nodecore.mt_old and "_old" or "") .. ".b3d"
|
||||
})
|
||||
player:set_local_animation(
|
||||
anim.stand,
|
||||
|
@ -1,6 +1,6 @@
|
||||
-- LUALOCALS < ---------------------------------------------------------
|
||||
local minetest, string, table
|
||||
= minetest, string, table
|
||||
local minetest, nodecore, table
|
||||
= minetest, nodecore, table
|
||||
local table_remove
|
||||
= table.remove
|
||||
-- LUALOCALS > ---------------------------------------------------------
|
||||
@ -103,10 +103,9 @@ minetest.register_on_joinplayer(function(player)
|
||||
|
||||
addslot(0, "Arm_Right", -2.5, 8, 0, 2, 178, 60)
|
||||
|
||||
local isold = minetest.get_version().string:sub(1, 2) == "0."
|
||||
local function cslot(n, x, z)
|
||||
return addslot(n, nil, x * 1.6,
|
||||
(isold and -4 or 5.5) + x / 2,
|
||||
(nodecore.mt_old and -4 or 5.5) + x / 2,
|
||||
z * 2.1)
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user