fixed Defense unittype

This commit is contained in:
Chris Forbes
2009-11-17 20:43:59 +13:00
parent 2c05e2d6e0
commit 746ab904e6
4 changed files with 10 additions and 10 deletions

View File

@@ -23,7 +23,7 @@ namespace OpenRa.Game.GameRules
public Cache<string, List<Actor>> GatherBuildings( Player player )
{
var ret = new Cache<string, List<Actor>>( x => new List<Actor>() );
foreach( var b in Game.world.Actors.Where( x => x.Owner == player && Rules.UnitCategory[ x.unitInfo.Name ] == "Building" ) )
foreach( var b in Game.world.Actors.Where( x => x.Owner == player && x.unitInfo is UnitInfo.BuildingInfo ) )
ret[ b.unitInfo.Name ].Add( b );
return ret;
}

View File

@@ -39,7 +39,7 @@ namespace OpenRa.Game
public void Tick()
{
var producing = Owner.Producing( "Building" );
var producing = Owner.Producing( Rules.UnitCategory[ Building.Name ] );
if( producing == null || producing.Item != Building.Name || producing.RemainingTime != 0 )
Game.world.AddFrameEndTask( _ => { Game.controller.orderGenerator = null; } );
}

View File

@@ -79,7 +79,7 @@ namespace OpenRa.Game
Game.world.AddFrameEndTask( _ =>
{
var building = (UnitInfo.BuildingInfo)Rules.UnitInfo[ order.TargetString ];
var producing = order.Player.Producing( "Building" );
var producing = order.Player.Producing(Rules.UnitCategory[order.TargetString]);
if( producing == null || producing.Item != order.TargetString || producing.RemainingTime != 0 )
return;
@@ -110,10 +110,10 @@ namespace OpenRa.Game
() => Game.world.AddFrameEndTask(
_ =>
{
var isBuilding = group == "Building" || group == "Defense";
if (order.Player == Game.LocalPlayer)
Game.PlaySound(group == "Building"
? "conscmp1.aud" : "unitrdy1.aud", false);
if (group != "Building" && group != "Defense")
Game.PlaySound( isBuilding ? "conscmp1.aud" : "unitrdy1.aud", false);
if (!isBuilding)
Game.BuildUnit(order.Player, order.TargetString);
})));
break;

View File

@@ -155,6 +155,9 @@ FTUR
GAP
SAM
MSLO
; SBAG
; BRIK
; FENC
[BuildingTypes]
@@ -175,9 +178,6 @@ BARR
TENT
KENN
FIX
; SBAG
; BRIK
; FENC
FACF
WEAF
SYRF
@@ -262,7 +262,7 @@ Description=Construction Yard
Traits=Building, RenderBuilding
Dimensions=3,3
Footprint=xxx xxx xxx
Produces=Building
Produces=Building,Defense
[PROC]
Description=Ore Refinery
Traits=Building, RenderBuilding, AcceptsOre