From 5adf2c3dca2fb425376268279de7207914fde7c1 Mon Sep 17 00:00:00 2001 From: Matthew Date: Mon, 28 Jan 2019 19:25:37 -0500 Subject: [PATCH] Fix calling obj.is_player before checking validity --- utils/game.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/utils/game.lua b/utils/game.lua index 8d6179be..0ef0209c 100644 --- a/utils/game.lua +++ b/utils/game.lua @@ -54,8 +54,8 @@ function Game.get_player_from_any(obj) p = Game.get_player_by_index(obj) elseif o_type == 'string' then p = game.players[obj] - elseif o_type == 'table' and obj.is_player() then - p = obj + elseif o_type == 'table' and obj.valid and obj.is_player() then + return obj end if p and p.valid then