gap shouldnt affect owner

This commit is contained in:
Chris Forbes
2010-01-17 10:51:53 +13:00
parent f8665fc6a0
commit c944b5fb9b
2 changed files with 6 additions and 2 deletions

View File

@@ -26,11 +26,12 @@ namespace OpenRa
public int PowerProvided = 0;
public int PowerDrained = 0;
public Shroud Shroud = new Shroud();
public Shroud Shroud;
public Dictionary<string, SupportPower> SupportPowers;
public Player( int index, Session.Client client )
{
Shroud = new Shroud(this);
Game.world.Add(this.PlayerActor = new Actor("Player", new int2(int.MaxValue, int.MaxValue), this));
this.Index = index;
this.InternalName = "Multi{0}".F(index);

View File

@@ -15,6 +15,9 @@ namespace OpenRa
Sprite[,] sprites = new Sprite[128, 128];
bool dirty = true;
bool hasGPS = false;
Player owner;
public Shroud(Player owner) { this.owner = owner; }
float gapOpaqueTicks = (int)(Rules.General.GapRegenInterval * 25 * 60);
int[,] gapField = new int[128, 128];
@@ -30,7 +33,7 @@ namespace OpenRa
{
// Clear active flags
gapActive = new bool[128, 128];
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<GeneratesGap>()))
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<GeneratesGap>() && owner != a.Owner))
{
foreach (var t in a.traits.Get<GeneratesGap>().GetShroudedTiles())
gapActive[t.X, t.Y] = true;