1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Passage de globales en locales

Adaptation des variables global en local pour la version 4.11
This commit is contained in:
guillaume 2015-01-11 21:25:25 +01:00
parent 3126d8a40d
commit 715ca50df1
17 changed files with 35 additions and 25 deletions

View File

@ -1,4 +1,4 @@
worldedit = worldedit or {}
worldedit = {}
local minetest = minetest --local copy of global
local get_pointed = function(pos, nearest, distance)
@ -100,4 +100,4 @@ worldedit.raytrace = function(pos, dir, callback)
intersectz = intersectz + componentz
end
end
end
end

View File

@ -5,7 +5,7 @@
-------------------------------------------------------
local S
if (intllib) then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else

View File

@ -695,4 +695,4 @@ if override_original == true then
minetest.punch_node(pos)
end
})
end
end

View File

@ -8,7 +8,7 @@
-- Boilerplate to support localized strings if intllib mod is installed.
S = 0
if (intllib) then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
@ -41,7 +41,7 @@ function food.support(group, item)
if idx <= 1 then
error("[Food Error] food.support - error in item name ('" .. item .. "')")
end
mod = string.sub(item, 1, idx - 1)
local mod = string.sub(item, 1, idx - 1)
if not minetest.get_modpath(mod) then
if food.debug then
@ -60,7 +60,7 @@ function food.support(group, item)
food.disable(group)
-- Add group
g = {}
local g = {}
if data.groups then
for k, v in pairs(data.groups) do
g[k] = v

View File

@ -8,7 +8,8 @@ moreblocks = {}
-- Load translation library if intllib is installed
local S -- Load translation library if intllib is installed:
if intllib then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end

View File

@ -1,5 +1,6 @@
local S -- Load translation library if intllib is installed:
if intllib then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end

View File

@ -1,5 +1,6 @@
local S -- Load translation library if intllib is installed:
if intllib then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end

View File

@ -1,5 +1,6 @@
local S -- Load translation library if intllib is installed:
if intllib then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end

View File

@ -1,5 +1,6 @@
local S -- Load translation library if intllib is installed:
if intllib then
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end

View File

@ -68,7 +68,7 @@ local sled = {
visual = "mesh",
mesh = "sled.x",
textures = {"sled.png"},
HUD,
HUD = nil,
driver = nil,
sliding = false,

View File

@ -264,7 +264,7 @@ local snow_nodes = {
"snow_brick",
"snow_cobble",
}
local drop = nil
for _, name in pairs(snow_nodes) do
local nodename = "snow:"..name
local ndef = minetest.registered_nodes[nodename]

View File

@ -48,7 +48,7 @@ local function loadConfig(path)
io.close(file)
for line in io.lines(path) do
if line:sub(1,1) ~= "#" then
i, v = line:match("^(%S*) = (%S*)")
local i, v = line:match("^(%S*) = (%S*)")
if i and v then
if v == "true" then v = true end
if v == "false" then v = false end

View File

@ -11,7 +11,8 @@ local players = {}
local staminaHud = {}
minetest.register_on_joinplayer(function(player)
playerName = player:get_player_name()
local playerName = player:get_player_name()
print("playename: " ..playerName)
players[playerName] = {
sprinting = false,
timeOut = 0,
@ -30,7 +31,7 @@ minetest.register_on_joinplayer(function(player)
}
end)
minetest.register_on_leaveplayer(function(player)
playerName = player:get_player_name()
local playerName = player:get_player_name()
players[playerName] = nil
end)
minetest.register_globalstep(function(dtime)

View File

@ -1,6 +1,7 @@
local S
if intllib then
S = intllib.Getter()
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end
end

View File

@ -4,8 +4,9 @@
-- License: GPLv3
local S
if intllib then
S = intllib.Getter()
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end
end

View File

@ -1,6 +1,7 @@
local S
if intllib then
S = intllib.Getter()
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end
end

View File

@ -1,6 +1,7 @@
local S
if intllib then
S = intllib.Getter()
if (minetest.get_modpath("intllib")) then
dofile(minetest.get_modpath("intllib").."/intllib.lua")
S = intllib.Getter(minetest.get_current_modname())
else
S = function(s) return s end
end