From 06e42034f349e74e619d87753efd4d381503c7b5 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 19 Sep 2024 14:17:26 +0200 Subject: [PATCH] Chessbot: Print out more errors in bad state --- src/chessbot.lua | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/chessbot.lua b/src/chessbot.lua index c3cfab1..6e0161c 100644 --- a/src/chessbot.lua +++ b/src/chessbot.lua @@ -80,7 +80,9 @@ function chessbot.choose_move(board_t, meta_t) end return choice_from, choice_to - + else + minetest.log("error", "[xdecor] Chess: chessbot.choose_move was apparently called in an invalid game state!") + return end end @@ -122,6 +124,7 @@ chessbot.perform_move = function(choice_from, choice_to, meta) end local botColor = meta:get_string("botColor") if botColor == "" then + minetest.log("error", "[xdecor] Chess: chessbot.perform_move: botColor in meta string was empty!") return end local lastMove = meta:get_string("lastMove") @@ -144,6 +147,8 @@ chessbot.perform_move = function(choice_from, choice_to, meta) if not moveOK then realchess.resign(meta, currentBotColor) end + else + minetest.log("error", "[xdecor] Chess: chessbot.perform_move: No last move!") end end