1
0
forked from mirrors/0ad

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.
This commit is contained in:
bb
2018-02-23 20:20:57 +00:00
parent c894eeb856
commit 0ace1b44b2
@@ -1604,6 +1604,7 @@ UnitAI.prototype.UnitFsmSpec = {
"leave": function(msg) { "leave": function(msg) {
this.StopTimer(); this.StopTimer();
this.SetDefaultAnimationVariant();
}, },
"MoveCompleted": function() { "MoveCompleted": function() {
@@ -1628,12 +1629,14 @@ UnitAI.prototype.UnitFsmSpec = {
} }
this.StartTimer(0, 1000); this.StartTimer(0, 1000);
this.SetAnimationVariant("combat");
this.SelectAnimation("move"); this.SelectAnimation("move");
}, },
"leave": function() { "leave": function() {
this.StopTimer(); this.StopTimer();
delete this.patrolStartPosOrder; delete this.patrolStartPosOrder;
this.SetDefaultAnimationVariant();
}, },
"Timer": function(msg) { "Timer": function(msg) {
@@ -1680,6 +1683,7 @@ UnitAI.prototype.UnitFsmSpec = {
"leave": function(msg) { "leave": function(msg) {
this.SetMoveSpeed(this.GetWalkSpeed()); this.SetMoveSpeed(this.GetWalkSpeed());
this.StopTimer(); this.StopTimer();
this.SetDefaultAnimationVariant();
}, },
"MoveStarted": function(msg) { "MoveStarted": function(msg) {
@@ -1708,6 +1712,7 @@ UnitAI.prototype.UnitFsmSpec = {
"enter": function () { "enter": function () {
this.StartTimer(1000, 1000); this.StartTimer(1000, 1000);
this.SetHeldPositionOnEntity(this.entity); this.SetHeldPositionOnEntity(this.entity);
this.SetAnimationVariant("combat");
this.SelectAnimation("idle"); this.SelectAnimation("idle");
return false; return false;
}, },
@@ -1744,6 +1749,7 @@ UnitAI.prototype.UnitFsmSpec = {
"leave": function(msg) { "leave": function(msg) {
this.StopTimer(); this.StopTimer();
this.SetDefaultAnimationVariant();
}, },
}, },
}, },
@@ -1892,6 +1898,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (cmpFormation) if (cmpFormation)
animationName = cmpFormation.GetFormationAnimation(this.entity, animationName); animationName = cmpFormation.GetFormationAnimation(this.entity, animationName);
} }
this.SetAnimationVariant("combat");
this.SelectAnimation(animationName, false, 1.0, animationName); this.SelectAnimation(animationName, false, 1.0, animationName);
this.SetAnimationSync(prepare, this.attackTimers.repeat); this.SetAnimationSync(prepare, this.attackTimers.repeat);
this.StartTimer(prepare, this.attackTimers.repeat); this.StartTimer(prepare, this.attackTimers.repeat);
@@ -1912,6 +1919,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (cmpBuildingAI) if (cmpBuildingAI)
cmpBuildingAI.SetUnitAITarget(0); cmpBuildingAI.SetUnitAITarget(0);
this.StopTimer(); this.StopTimer();
this.SetDefaultAnimationVariant();
}, },
"Timer": function(msg) { "Timer": function(msg) {
@@ -2197,6 +2205,7 @@ UnitAI.prototype.UnitFsmSpec = {
if (cmpSupply) if (cmpSupply)
cmpSupply.RemoveGatherer(this.entity); cmpSupply.RemoveGatherer(this.entity);
delete this.gatheringTarget; delete this.gatheringTarget;
this.SetDefaultAnimationVariant();
}, },
}, },