#597 fix crash when spawning mapactors if there is no player in the slot. said actors are not spawned now.
This commit is contained in:
@@ -8,7 +8,8 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
@@ -22,7 +23,12 @@ namespace OpenRA.Mods.RA
|
||||
public void WorldLoaded(World world)
|
||||
{
|
||||
foreach (var actorReference in world.Map.Actors.Value)
|
||||
{
|
||||
{
|
||||
// if there is no real player associated, dont spawn it.
|
||||
var ownerName = actorReference.Value.InitDict.Get<OwnerInit>().PlayerName;
|
||||
if (!world.players.Values.Any(p => p.InternalName == ownerName))
|
||||
continue;
|
||||
|
||||
var initDict = actorReference.Value.InitDict;
|
||||
initDict.Add(new SkipMakeAnimsInit());
|
||||
Actors[actorReference.Key] = world.CreateActor(actorReference.Value.Type, initDict);
|
||||
|
||||
Reference in New Issue
Block a user