Make 'realchess' table private again
This commit is contained in:
parent
6a19130042
commit
ecf9af4f85
@ -4,8 +4,16 @@ if minetest.get_modpath("realchess") ~= nil then
|
|||||||
minetest.log("action", "[xdecor] 'realchess' mod detected. Disabling X-Decor-libre's Chess module in favor of realchess")
|
minetest.log("action", "[xdecor] 'realchess' mod detected. Disabling X-Decor-libre's Chess module in favor of realchess")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
realchess = {}
|
|
||||||
|
-- For making some functions available for the chessbot.
|
||||||
|
-- It is NOT recommended to use the public chess function outside of this mod!
|
||||||
|
xdecor.chess = {}
|
||||||
|
|
||||||
|
local realchess = xdecor.chess -- just an alias
|
||||||
|
|
||||||
|
-- Load chess bot code
|
||||||
local chessbot = dofile(minetest.get_modpath(minetest.get_current_modname()).."/src/chessbot.lua")
|
local chessbot = dofile(minetest.get_modpath(minetest.get_current_modname()).."/src/chessbot.lua")
|
||||||
|
|
||||||
screwdriver = screwdriver or {}
|
screwdriver = screwdriver or {}
|
||||||
|
|
||||||
-- Translation init
|
-- Translation init
|
||||||
@ -804,6 +812,7 @@ local function get_theoretical_moves_from(meta, board, from_idx)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- Rate the possible moves depending on its piece value
|
-- Rate the possible moves depending on its piece value
|
||||||
|
-- TODO: Move this to chessbot.lua
|
||||||
for i in pairs(moves) do
|
for i in pairs(moves) do
|
||||||
local stack_name = board[tonumber(i)]
|
local stack_name = board[tonumber(i)]
|
||||||
if stack_name ~= "" then
|
if stack_name ~= "" then
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
local chessbot = {}
|
local chessbot = {}
|
||||||
|
|
||||||
|
local realchess = xdecor.chess
|
||||||
|
|
||||||
-- Delay in seconds for a bot moving a piece (excluding choosing a promotion)
|
-- Delay in seconds for a bot moving a piece (excluding choosing a promotion)
|
||||||
local BOT_DELAY_MOVE = 1.0
|
local BOT_DELAY_MOVE = 1.0
|
||||||
-- Delay in seconds for a bot promoting a piece
|
-- Delay in seconds for a bot promoting a piece
|
||||||
|
Loading…
x
Reference in New Issue
Block a user