1
0
forked from 0ad/0ad

UnitAI's CanGather should always return false if the target isn't a resource.

This was SVN commit r12533.
This commit is contained in:
Deiz 2012-08-27 01:35:53 +00:00
parent b462f2acfe
commit 2de4786240

View File

@ -3341,6 +3341,11 @@ UnitAI.prototype.CanGarrison = function(target)
UnitAI.prototype.CanGather = function(target) UnitAI.prototype.CanGather = function(target)
{ {
// The target must be a valid resource supply.
var cmpResourceSupply = Engine.QueryInterface(target, IID_ResourceSupply);
if (!cmpResourceSupply)
return false;
// Formation controllers should always respond to commands // Formation controllers should always respond to commands
// (then the individual units can make up their own minds) // (then the individual units can make up their own minds)
if (this.IsFormationController()) if (this.IsFormationController())