1
0
mirror of https://github.com/Refactorio/RedMew.git synced 2024-12-12 10:04:40 +02:00

Fix calling obj.is_player before checking validity

This commit is contained in:
Matthew 2019-01-28 19:25:37 -05:00 committed by GitHub
parent 4dd4056592
commit 5adf2c3dca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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