Run luacheck and fix warnings.
Update `lastMove` instead of redefine.
This commit is contained in:
parent
6528615c92
commit
df78a33f20
7
.luacheckrc
Normal file
7
.luacheckrc
Normal file
@ -0,0 +1,7 @@
|
||||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
read_globals = {
|
||||
"minetest",
|
||||
"default",
|
||||
}
|
4
init.lua
4
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").."] "..
|
||||
|
Loading…
x
Reference in New Issue
Block a user