Fix a possible crash in the lua Player.Team property

This commit is contained in:
abcdefg30
2016-08-27 19:44:37 +02:00
parent 57d6f678e1
commit 284d5e5af5

View File

@@ -54,7 +54,7 @@ namespace OpenRA.Mods.Common.Scripting
{
get
{
var c = Player.World.LobbyInfo.Clients[Player.ClientIndex];
var c = Player.World.LobbyInfo.Clients.FirstOrDefault(i => i.Index == Player.ClientIndex);
return c != null ? c.Team : 0;
}
}