Ticket #3444: UnitAI_animal_behavior_with_elexis_suggestion.diff
File UnitAI_animal_behavior_with_elexis_suggestion.diff, 1.2 KB (added by , 8 years ago) |
---|
-
UnitAI.js
1699 1699 this.SetGathererAnimationOverride(true); 1700 1700 1701 1701 this.SelectAnimation("move"); 1702 if (this.IsAnimal()) 1703 this.SetMoveSpeed(this.GetRunSpeed()); 1704 1702 1705 this.StartTimer(1000, 1000); 1703 1706 }, 1704 1707 1708 "HealthChanged": function() { 1709 if (this.IsAnimal()) 1710 this.SetMoveSpeed(this.GetRunSpeed()); 1711 }, 1712 1705 1713 "leave": function() { 1706 1714 // Show carried resources when walking. 1707 1715 this.SetGathererAnimationOverride(); 1708 1716 1717 if (this.IsAnimal()) 1718 this.SetMoveSpeed(this.GetRunSpeed()); 1719 1709 1720 this.StopTimer(); 1710 1721 }, 1711 1722 … … 1985 1996 1986 1997 this.SelectAnimation("move"); 1987 1998 var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI); 1988 if (cmpUnitAI && cmpUnitAI.IsFleeing()) 1989 { 1990 // Run after a fleeing target 1991 var speed = this.GetRunSpeed(); 1992 this.SetMoveSpeed(speed); 1993 } 1999 if (cmpUnitAI && cmpUnitAI.IsFleeing() || this.IsAnimal()) 2000 this.SetMoveSpeed(this.GetRunSpeed()); 2001 1994 2002 this.StartTimer(1000, 1000); 1995 2003 }, 1996 2004