Merge pull request #35 from Valansch/core

Fixed most unlikely edgecase
This commit is contained in:
Cooldude2606
2018-04-18 22:07:14 +01:00
committed by GitHub

View File

@@ -58,6 +58,14 @@ function Game.get_player(mixed)
end
elseif mixed then
local player = game.players[mixed]
if type(mixed) == "string" and tonumber(mixed) then
for _, p in pairs(game.players) do
if p.name == mixed then
player = p
break
end
end
end
return player and player.valid and player
end
end