fixed Defense unittype
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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; } );
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user