check ResourceGatherer interface before trying to gather, fixes #2801

This was SVN commit r15812.
This commit is contained in:
mimo 2014-09-26 21:23:32 +00:00
parent 119aad9da9
commit b524f59657

View File

@ -5058,7 +5058,10 @@ UnitAI.prototype.GatherNearPosition = function(x, z, type, template, queued)
if (template.indexOf("resource|") != -1)
template = template.slice(9);
this.AddOrder("GatherNearPosition", { "type": type, "template": template, "x": x, "z": z, "force": false }, queued);
if (!Engine.QueryInterface(this.entity, IID_ResourceGatherer))
this.AddOrder("Walk", { "x": x, "z": z, "force": false }, queued);
else
this.AddOrder("GatherNearPosition", { "type": type, "template": template, "x": x, "z": z, "force": false }, queued);
};
/**