diff --git a/.luacheckrc b/.luacheckrc new file mode 100644 index 0000000..a21bce1 --- /dev/null +++ b/.luacheckrc @@ -0,0 +1,7 @@ +unused_args = false +allow_defined_top = true + +read_globals = { + "minetest", + "default", +} diff --git a/init.lua b/init.lua index 192b6b0..6312b81 100644 --- a/init.lua +++ b/init.lua @@ -504,9 +504,9 @@ function realchess.move(pos, from_list, from_index, to_list, to_index, _, player meta:set_string("playerWhite", playerWhite) meta:set_string("playerBlack", playerBlack) - meta:set_string("lastMove", thisMove) + lastMove = thisMove + meta:set_string("lastMove", lastMove) meta:set_int("lastMoveTime", minetest.get_gametime()) - local lastMove = meta:get_string("lastMove") if lastMove == "black" then minetest.chat_send_player(playerWhite, "["..os.date("%H:%M:%S").."] "..