move CYard trait and UndeployMCV activity into mod
This commit is contained in:
@@ -52,14 +52,20 @@ namespace OpenRA.Mods.RA.Orders
|
||||
|
||||
public void Tick( World world )
|
||||
{
|
||||
var hasFact = world.Queries.OwnedBy[world.LocalPlayer]
|
||||
.WithTrait<ConstructionYard>()
|
||||
.Any();
|
||||
|
||||
if (!hasFact)
|
||||
if( PlayerIsAllowedToRepair( world ) )
|
||||
Game.controller.CancelInputMode();
|
||||
}
|
||||
|
||||
public static bool PlayerIsAllowedToRepair( World world )
|
||||
{
|
||||
if( !world.WorldActor.Info.Traits.Get<RepairButtonInfo>().RequiresConstructionYard )
|
||||
return true;
|
||||
|
||||
return Game.world.Queries.OwnedBy[ Game.world.LocalPlayer ]
|
||||
.WithTrait<Production>().Where( x => x.Actor.Info.Traits.Get<ProductionInfo>().Produces.Contains( "Building" ) )
|
||||
.Any();
|
||||
}
|
||||
|
||||
public void Render( World world ) {}
|
||||
|
||||
public string GetCursor(World world, int2 xy, MouseInput mi)
|
||||
|
||||
Reference in New Issue
Block a user