Chess: Make board diggable if game completed
This commit is contained in:
parent
76f5285a56
commit
f511bd1950
@ -3029,9 +3029,12 @@ function realchess.dig(pos, player)
|
|||||||
local playerBlack = meta:get_string("playerBlack")
|
local playerBlack = meta:get_string("playerBlack")
|
||||||
local botColor = meta:get_string("botColor")
|
local botColor = meta:get_string("botColor")
|
||||||
|
|
||||||
|
if (gameResult ~= "") then
|
||||||
|
-- If the game was completed, the board is free to be dug
|
||||||
|
return true
|
||||||
-- If the game is ongoing and no move was made for TIMEOUT seconds,
|
-- If the game is ongoing and no move was made for TIMEOUT seconds,
|
||||||
-- the board is free to be dug
|
-- the board is free to be dug
|
||||||
if (lastMoveTime == 0 and minetest.get_gametime() > timeout_limit) then
|
elseif (lastMoveTime == 0 and minetest.get_gametime() > timeout_limit) then
|
||||||
return true
|
return true
|
||||||
else
|
else
|
||||||
if playerName == playerWhite or playerName == playerBlack or botColor == "both" then
|
if playerName == playerWhite or playerName == playerBlack or botColor == "both" then
|
||||||
|
Loading…
Reference in New Issue
Block a user