]> git.lizzy.rs Git - xdecor.git/commitdiff
Chess: Don't crash on nil-player calling can_dig.
authorTim <t4im@users.noreply.github.com>
Fri, 5 Aug 2016 19:03:22 +0000 (21:03 +0200)
committerTim <t4im@users.noreply.github.com>
Fri, 5 Aug 2016 19:03:22 +0000 (21:03 +0200)
chess.lua

index 8e0691e0bc966744f2d4748ceae418c9674991df..baeab14a9a065c6598269bcbe81842cd2de2f031 100644 (file)
--- a/chess.lua
+++ b/chess.lua
@@ -556,6 +556,9 @@ function realchess.fields(pos, _, fields, sender)
 end
 
 function realchess.dig(pos, player)
+       if not player then
+               return false
+       end
        local meta = minetest.get_meta(pos)
        local playerName = player:get_player_name()
        local timeout_limit = meta:get_int("lastMoveTime") + 300