mirror of
https://gitea.wildfiregames.com/0ad/0ad
synced 2026-07-04 05:55:47 -07:00
Lower number of setdefaultanimation calls in gathering state
Move call to SetDefaultAnimationVariant to leave function upon leaving GATHERING state instead for every one substate leave. Differential Revision: https://code.wildfiregames.com/D2565 This was SVN commit r23474.
This commit is contained in:
parent
045c3c9d5f
commit
a6159e4ac6
1 changed files with 5 additions and 4 deletions
|
|
@ -2144,6 +2144,11 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
},
|
||||
|
||||
"GATHER": {
|
||||
"leave": function() {
|
||||
// Show the carried resource, if we've gathered anything.
|
||||
this.SetDefaultAnimationVariant();
|
||||
},
|
||||
|
||||
"APPROACHING": {
|
||||
"enter": function() {
|
||||
this.gatheringTarget = this.order.data.target; // temporary, deleted in "leave".
|
||||
|
|
@ -2186,7 +2191,6 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
"leave": function() {
|
||||
this.StopMoving();
|
||||
|
||||
this.SetDefaultAnimationVariant();
|
||||
if (!this.gatheringTarget)
|
||||
return;
|
||||
// don't use ownership because this is called after a conversion/resignation
|
||||
|
|
@ -2211,7 +2215,6 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
},
|
||||
|
||||
"leave": function() {
|
||||
this.SetDefaultAnimationVariant();
|
||||
this.StopMoving();
|
||||
},
|
||||
|
||||
|
|
@ -2294,9 +2297,7 @@ UnitAI.prototype.UnitFsmSpec = {
|
|||
cmpSupply.RemoveGatherer(this.entity);
|
||||
delete this.gatheringTarget;
|
||||
|
||||
// Show the carried resource, if we've gathered anything.
|
||||
this.ResetAnimation();
|
||||
this.SetDefaultAnimationVariant();
|
||||
},
|
||||
|
||||
"Timer": function(msg) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue