check ResourceGatherer interface before trying to gather, fixes #2801
This was SVN commit r15812.
This commit is contained in:
parent
119aad9da9
commit
b524f59657
@ -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);
|
||||
};
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user