mines are invisible to others
This commit is contained in:
@@ -181,6 +181,7 @@
|
||||
<Compile Include="Traits\Harvester.cs" />
|
||||
<Compile Include="Traits\Helicopter.cs" />
|
||||
<Compile Include="Traits\Infantry.cs" />
|
||||
<Compile Include="Traits\InvisibleToOthers.cs" />
|
||||
<Compile Include="Traits\Minelayer.cs" />
|
||||
<Compile Include="Traits\Plane.cs" />
|
||||
<Compile Include="Traits\ProductionQueue.cs" />
|
||||
|
||||
18
OpenRa.Game/Traits/InvisibleToOthers.cs
Normal file
18
OpenRa.Game/Traits/InvisibleToOthers.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class InvisibleToOthers : IRenderModifier
|
||||
{
|
||||
public InvisibleToOthers(Actor self) { }
|
||||
|
||||
public IEnumerable<Renderable> ModifyRender(Actor self, IEnumerable<Renderable> r)
|
||||
{
|
||||
return Game.LocalPlayer == self.Owner
|
||||
? r : new Renderable[] { };
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,7 +83,7 @@ namespace OpenRa.Game.Traits
|
||||
case "Plane":
|
||||
return UnitMovementType.Fly;
|
||||
default:
|
||||
throw new InvalidOperationException("GetMovementType on unit that shouldn't be aable to move.");
|
||||
throw new InvalidOperationException("GetMovementType on unit that shouldn't be able to move.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user