1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-16 23:40:31 +01:00

Avoid crash when commandblocks are forced to be used (forceload)

This commit is contained in:
LeMagnesium 2015-07-21 18:12:38 +02:00
parent 4c0e117706
commit 31c40de110

View File

@ -107,11 +107,16 @@ local function resolve_commands(commands, pos)
farthest = player:get_player_name() farthest = player:get_player_name()
end end
end end
local random = players[math.random(#players)]:get_player_name() local randomp = players[math.random(#players)]
commands = commands:gsub("@nearest", nearest) if randomp then
commands = commands:gsub("@farthest", farthest) local random = randomp:get_player_name()
commands = commands:gsub("@random", random) commands = commands:gsub("@nearest", nearest)
return commands commands = commands:gsub("@farthest", farthest)
commands = commands:gsub("@random", random)
return commands
else
return ""
end
end end
local function commandblock_action_on(pos, node) local function commandblock_action_on(pos, node)