Fixed most unlikely edgecase

In case of numerical username
This commit is contained in:
Valansch
2018-04-18 23:03:20 +02:00
committed by GitHub
parent 0d9583fde7
commit 62e361b2dd

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