Fix obstructed entities being able to drop off resources.
Introduced in 7ba4b1ffc8
by not checking the range anymore.
Reported by @FFFF at
https://wildfiregames.com/forum/topic/72985-stuck-units-delivering-resourses/.
Differential revision: https://code.wildfiregames.com/D4531
Tested by: @Langbart
Fixes #6446
This was SVN commit r26619.
This commit is contained in:
parent
41033d951e
commit
dff79a388b
@ -2679,7 +2679,8 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
"DROPPINGRESOURCES": {
|
||||
"enter": function() {
|
||||
let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
|
||||
if (this.CanReturnResource(this.order.data.target, true, cmpResourceGatherer))
|
||||
if (this.CanReturnResource(this.order.data.target, true, cmpResourceGatherer) &&
|
||||
cmpResourceGatherer.IsTargetInRange(this.order.data.target))
|
||||
{
|
||||
cmpResourceGatherer.CommitResources(this.order.data.target);
|
||||
this.SetNextState("GATHER.APPROACHING");
|
||||
@ -2823,7 +2824,8 @@ UnitAI.prototype.UnitFsmSpec = {
|
||||
"DROPPINGRESOURCES": {
|
||||
"enter": function() {
|
||||
let cmpResourceGatherer = Engine.QueryInterface(this.entity, IID_ResourceGatherer);
|
||||
if (this.CanReturnResource(this.order.data.target, true, cmpResourceGatherer))
|
||||
if (this.CanReturnResource(this.order.data.target, true, cmpResourceGatherer) &&
|
||||
cmpResourceGatherer.IsTargetInRange(this.order.data.target))
|
||||
{
|
||||
cmpResourceGatherer.CommitResources(this.order.data.target);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user