Ticket #3444: UnitAI.diff
File UnitAI.diff, 1.5 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 this.SetMoveSpeed(this.GetWalkSpeed()); 1718 1709 1719 this.StopTimer(); 1710 1720 }, 1711 1721 … … 1985 1995 1986 1996 this.SelectAnimation("move"); 1987 1997 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 } 1998 if (cmpUnitAI && cmpUnitAI.IsFleeing() || this.IsAnimal()) 1999 this.SetMoveSpeed(this.GetRunSpeed()); 2000 1994 2001 this.StartTimer(1000, 1000); 1995 2002 }, 1996 2003 … … 1998 2005 var cmpUnitAI = Engine.QueryInterface(this.order.data.target, IID_UnitAI); 1999 2006 if (!cmpUnitAI || !cmpUnitAI.IsFleeing()) 2000 2007 return; 2001 var speed = this.GetRunSpeed();2002 this.SetMoveSpeed(speed);2008 if (this.IsAnimal()) 2009 this.SetMoveSpeed(this.GetRunSpeed()); 2003 2010 }, 2004 2011 2005 2012 "leave": function() {