Run luacheck and fix warnings.

Update `lastMove` instead of redefine.
This commit is contained in:
Tim 2016-08-05 15:48:14 +02:00
parent 6528615c92
commit df78a33f20
2 changed files with 9 additions and 2 deletions

7
.luacheckrc Normal file
View File

@ -0,0 +1,7 @@
unused_args = false
allow_defined_top = true
read_globals = {
"minetest",
"default",
}

View File

@ -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").."] "..