Ticket #1832: abandonchase.diff
File abandonchase.diff, 847 bytes (added by , 11 years ago) |
---|
-
binaries/data/mods/public/simulation/components/UnitAI.js
3304 3304 */ 3305 3305 UnitAI.prototype.ShouldAbandonChase = function(target, force, iid) 3306 3306 { 3307 // Wild animal should not continue if target is too far 3308 // TODO find best cut, value 80 chosen because this "far" should nonetheless be bigger 3309 // than the range attacks, to allow these animals to defend themselves. 3310 if (this.IsAnimal() && !this.IsDomestic()) 3311 { 3312 var distance = DistanceBetweenEntities(this.entity, target); 3313 if (distance > 80) 3314 return true; 3315 } 3316 3307 3317 // Forced orders shouldn't be interrupted. 3308 3318 if (force) 3309 3319 return false;