BUGFIX: with PlaceBuilding active, you could cancel the current production, then place the (canceled) building.
This commit is contained in:
@@ -40,6 +40,11 @@ namespace OpenRa.Game
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Tick() { }
|
public void Tick()
|
||||||
|
{
|
||||||
|
var producing = Owner.Producing( "Building" );
|
||||||
|
if( producing == null || producing.Item != Name || producing.RemainingTime != 0 )
|
||||||
|
Game.world.AddFrameEndTask( _ => { Game.controller.orderGenerator = null; } );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,13 +69,14 @@ namespace OpenRa.Game
|
|||||||
Game.world.AddFrameEndTask( _ =>
|
Game.world.AddFrameEndTask( _ =>
|
||||||
{
|
{
|
||||||
var building = Rules.UnitInfo[ order.TargetString ];
|
var building = Rules.UnitInfo[ order.TargetString ];
|
||||||
|
var producing = order.Player.Producing( "Building" );
|
||||||
|
if( producing == null || producing.Item != order.TargetString || producing.RemainingTime != 0 )
|
||||||
|
return;
|
||||||
|
|
||||||
Log.Write( "Player \"{0}\" builds {1}", order.Player.PlayerName, building.Name );
|
Log.Write( "Player \"{0}\" builds {1}", order.Player.PlayerName, building.Name );
|
||||||
|
|
||||||
//Adjust placement for cursor to be in middle
|
|
||||||
Game.world.Add( new Actor( building.Name, order.TargetLocation - GameRules.Footprint.AdjustForBuildingSize( building.Name ), order.Player ) );
|
Game.world.Add( new Actor( building.Name, order.TargetLocation - GameRules.Footprint.AdjustForBuildingSize( building.Name ), order.Player ) );
|
||||||
|
|
||||||
Game.controller.orderGenerator = null;
|
|
||||||
|
|
||||||
order.Player.FinishProduction(Rules.UnitCategory[building.Name]);
|
order.Player.FinishProduction(Rules.UnitCategory[building.Name]);
|
||||||
} );
|
} );
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user