give Gap Generator to allies

This commit is contained in:
Curtis Shmyr
2012-03-24 09:09:22 -06:00
committed by Chris Forbes
parent beb6b01796
commit 891cba456b
4 changed files with 67 additions and 10 deletions

View File

@@ -112,6 +112,24 @@ namespace OpenRA.Traits
Dirty();
}
public void HideActor(Actor a, int range)
{
if (a.Owner.World.LocalPlayer == null
|| a.Owner.Stances[a.Owner.World.LocalPlayer] == Stance.Ally) return;
var v = new ActorVisibility
{
vis = GetVisOrigins(a).ToArray()
};
foreach (var p in v.vis)
foreach (var q in FindVisibleTiles(a.World, p, range))
exploredCells[q.X, q.Y] = visibleCells[q.X, q.Y] > 0;
if (!Disabled)
Dirty();
}
public void UpdatePlayerStance(World w, Player player, Stance oldStance, Stance newStance)
{
if (oldStance == newStance)