diff --git a/OpenRa.Game/Actor.cs b/OpenRa.Game/Actor.cs index 42c22fdafc..7c34977179 100755 --- a/OpenRa.Game/Actor.cs +++ b/OpenRa.Game/Actor.cs @@ -20,16 +20,21 @@ namespace OpenRa.Game public readonly uint ActorID; public int2 Location; public Player Owner; - public int Health; - - public Actor( string name, int2 location, Player owner ) + public int Health; + public readonly bool IsMapActor; + + public Actor(string name, int2 location, Player owner) + : this( name, location, owner, false ) {} + + public Actor( string name, int2 location, Player owner, bool isMapActor ) { ActorID = Game.world.NextAID(); unitInfo = Rules.UnitInfo[ name ]; Location = location; CenterLocation = new float2( 12, 12 ) + Game.CellSize * (float2)Location; Owner = owner; - Health = unitInfo.Strength; /* todo: handle cases where this is not true! */ + Health = unitInfo.Strength; /* todo: handle cases where this is not true! */ + IsMapActor = isMapActor; if( unitInfo.Traits != null ) { diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index f8e262107e..d368b16407 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -87,7 +87,7 @@ namespace OpenRa.Game //num=owner,type,health,location,facing,trigger,unknown,shouldRepair var parts = s.Value.ToLowerInvariant().Split( ',' ); var loc = int.Parse( parts[ 3 ] ); - world.Add( new Actor( parts[ 1 ], new int2( loc % 128, loc / 128 ), players[ 0 ] ) ); + world.Add( new Actor( parts[ 1 ], new int2( loc % 128, loc / 128 ), players[ 0 ], true ) ); } } @@ -98,7 +98,7 @@ namespace OpenRa.Game //num=owner,type,health,location,facing,action,trigger var parts = s.Value.ToLowerInvariant().Split( ',' ); var loc = int.Parse( parts[ 3 ] ); - world.Add( new Actor( parts[ 1 ], new int2( loc % 128, loc / 128 ), players[ 0 ] ) ); + world.Add( new Actor( parts[ 1 ], new int2( loc % 128, loc / 128 ), players[ 0 ], true ) ); } } diff --git a/OpenRa.Game/Traits/RenderBuilding.cs b/OpenRa.Game/Traits/RenderBuilding.cs index 7b981103c2..fb3f581aa3 100644 --- a/OpenRa.Game/Traits/RenderBuilding.cs +++ b/OpenRa.Game/Traits/RenderBuilding.cs @@ -18,13 +18,16 @@ namespace OpenRa.Game.Traits public RenderBuilding(Actor self) : base(self) { - anim.PlayThen("make", () => anim.PlayRepeating("idle")); + if (self.IsMapActor) + anim.PlayRepeating("idle"); + else + anim.PlayThen("make", () => anim.PlayRepeating("idle")); + DoBib(self, false); } void DoBib(Actor self, bool isRemove) { - // at this point, we already know where we are, so we can safely place the bib in the smudge var buildingInfo = (UnitInfo.BuildingInfo)self.unitInfo; if (buildingInfo.Bib) {