Merge pull request #10568 from abcdefg30/waterCrates
Fix crates not showing their water animation
This commit is contained in:
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class WithCrateBody : INotifyParachuteLanded
|
class WithCrateBody : INotifyParachuteLanded, INotifyAddedToWorld
|
||||||
{
|
{
|
||||||
readonly Actor self;
|
readonly Actor self;
|
||||||
readonly Animation anim;
|
readonly Animation anim;
|
||||||
@@ -57,7 +57,21 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
rs.Add(anim);
|
rs.Add(anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnLanded()
|
void INotifyAddedToWorld.AddedToWorld(Actor self)
|
||||||
|
{
|
||||||
|
// Don't change animations while still in air
|
||||||
|
if (!self.IsAtGroundLevel())
|
||||||
|
return;
|
||||||
|
|
||||||
|
PlaySequence();
|
||||||
|
}
|
||||||
|
|
||||||
|
void INotifyParachuteLanded.OnLanded()
|
||||||
|
{
|
||||||
|
PlaySequence();
|
||||||
|
}
|
||||||
|
|
||||||
|
void PlaySequence()
|
||||||
{
|
{
|
||||||
var sequence = self.World.Map.GetTerrainInfo(self.Location).IsWater ? info.WaterSequence : info.LandSequence;
|
var sequence = self.World.Map.GetTerrainInfo(self.Location).IsWater ? info.WaterSequence : info.LandSequence;
|
||||||
if (!string.IsNullOrEmpty(sequence))
|
if (!string.IsNullOrEmpty(sequence))
|
||||||
|
|||||||
Reference in New Issue
Block a user