From 0ace1b44b2c691536068b903bdc1611883d2d0d7 Mon Sep 17 00:00:00 2001 From: bb Date: Fri, 23 Feb 2018 20:20:57 +0000 Subject: [PATCH] Learn males chopped wood is not a weapon to fight with. Use correct variants in animations form UnitAI. Patch By: wraitii Reviewed By: temple Differential Revision: https://code.wildfiregames.com/D1239 fixes #4932 This was SVN commit r21337. --- .../data/mods/public/simulation/components/UnitAI.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/binaries/data/mods/public/simulation/components/UnitAI.js b/binaries/data/mods/public/simulation/components/UnitAI.js index b26a59dfb9..bae08f4764 100644 --- a/binaries/data/mods/public/simulation/components/UnitAI.js +++ b/binaries/data/mods/public/simulation/components/UnitAI.js @@ -1604,6 +1604,7 @@ UnitAI.prototype.UnitFsmSpec = { "leave": function(msg) { this.StopTimer(); + this.SetDefaultAnimationVariant(); }, "MoveCompleted": function() { @@ -1628,12 +1629,14 @@ UnitAI.prototype.UnitFsmSpec = { } this.StartTimer(0, 1000); + this.SetAnimationVariant("combat"); this.SelectAnimation("move"); }, "leave": function() { this.StopTimer(); delete this.patrolStartPosOrder; + this.SetDefaultAnimationVariant(); }, "Timer": function(msg) { @@ -1680,6 +1683,7 @@ UnitAI.prototype.UnitFsmSpec = { "leave": function(msg) { this.SetMoveSpeed(this.GetWalkSpeed()); this.StopTimer(); + this.SetDefaultAnimationVariant(); }, "MoveStarted": function(msg) { @@ -1708,6 +1712,7 @@ UnitAI.prototype.UnitFsmSpec = { "enter": function () { this.StartTimer(1000, 1000); this.SetHeldPositionOnEntity(this.entity); + this.SetAnimationVariant("combat"); this.SelectAnimation("idle"); return false; }, @@ -1744,6 +1749,7 @@ UnitAI.prototype.UnitFsmSpec = { "leave": function(msg) { this.StopTimer(); + this.SetDefaultAnimationVariant(); }, }, }, @@ -1892,6 +1898,7 @@ UnitAI.prototype.UnitFsmSpec = { if (cmpFormation) animationName = cmpFormation.GetFormationAnimation(this.entity, animationName); } + this.SetAnimationVariant("combat"); this.SelectAnimation(animationName, false, 1.0, animationName); this.SetAnimationSync(prepare, this.attackTimers.repeat); this.StartTimer(prepare, this.attackTimers.repeat); @@ -1912,6 +1919,7 @@ UnitAI.prototype.UnitFsmSpec = { if (cmpBuildingAI) cmpBuildingAI.SetUnitAITarget(0); this.StopTimer(); + this.SetDefaultAnimationVariant(); }, "Timer": function(msg) { @@ -2197,6 +2205,7 @@ UnitAI.prototype.UnitFsmSpec = { if (cmpSupply) cmpSupply.RemoveGatherer(this.entity); delete this.gatheringTarget; + this.SetDefaultAnimationVariant(); }, },