Actor.traits is implementation detail
This commit is contained in:
@@ -1,19 +1,19 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
using System.Linq;
|
||||
using OpenRA.Traits;
|
||||
using OpenRA.FileFormats;
|
||||
|
||||
namespace OpenRA.Mods.RA
|
||||
{
|
||||
public class CrateSpawnerInfo : TraitInfo<CrateSpawner>
|
||||
@@ -62,14 +62,14 @@ namespace OpenRA.Mods.RA
|
||||
if (!(inWater ? info.ValidWater : info.ValidGround).Contains(terrainType)) continue;
|
||||
|
||||
// Don't spawn on any actors
|
||||
if (self.World.WorldActor.traits.Get<BuildingInfluence>().GetBuildingAt(p) != null) continue;
|
||||
if (self.World.WorldActor.traits.Get<UnitInfluence>().GetUnitsAt(p).Any()) continue;
|
||||
if (self.World.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(p) != null) continue;
|
||||
if (self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt(p).Any()) continue;
|
||||
|
||||
self.World.AddFrameEndTask(
|
||||
w => crates.Add(w.CreateActor("crate", new TypeDictionary
|
||||
{
|
||||
new LocationInit( p ),
|
||||
new OwnerInit( self.World.WorldActor.Owner ),
|
||||
w => crates.Add(w.CreateActor("crate", new TypeDictionary
|
||||
{
|
||||
new LocationInit( p ),
|
||||
new OwnerInit( self.World.WorldActor.Owner ),
|
||||
})));
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user