Index: binaries/data/mods/public/simulation/components/Identity.js =================================================================== --- binaries/data/mods/public/simulation/components/Identity.js (revision 8296) +++ binaries/data/mods/public/simulation/components/Identity.js (working copy) @@ -99,6 +99,11 @@ { }; +Identity.prototype.GetGenericName = function() +{ + return this.template.GenericName; +}; + Identity.prototype.GetCiv = function() { return this.template.Civ; Index: binaries/data/mods/public/simulation/components/UnitAI.js =================================================================== --- binaries/data/mods/public/simulation/components/UnitAI.js (revision 8296) +++ binaries/data/mods/public/simulation/components/UnitAI.js (working copy) @@ -117,7 +117,7 @@ "Order.Gather": function(msg) { // If the target is still alive, we need to kill it first - if (this.TargetIsAlive(this.order.data.target)) + if (this.TargetIsAnimal(this.order.data.target) && this.TargetIsAlive(this.order.data.target)) { // Make sure we can attack the target, else we'll get very stuck if (!this.GetBestAttack()) @@ -736,6 +736,13 @@ return (cmpHealth.GetHitpoints() != 0); }; +UnitAI.prototype.TargetIsAnimal = function(ent) +{ + var cmpIdentity = Engine.QueryInterface(ent, IID_Identity); + + return (cmpIdentity.GetGenericName() == "Fauna"); +}; + /** * Play a sound appropriate to the current entity. */