Fix missing return in 3c4a341906.

Caused entities to walk to the edge of the map when their dropsite was
destroyed.

This was SVN commit r25211.
This commit is contained in:
Freagarach 2021-04-08 10:34:48 +00:00
parent 76acc4e146
commit f5a0ab81b6

View File

@ -2531,10 +2531,11 @@ UnitAI.prototype.UnitFsmSpec = {
"InventoryFilled": function(msg) {
let nearestDropsite = this.FindNearestDropsite(this.order.data.type.generic);
if (!nearestDropsite)
if (nearestDropsite)
this.PushOrderFront("ReturnResource", { "target": nearestDropsite, "force": false });
else
this.FinishOrder();
this.PushOrderFront("ReturnResource", { "target": nearestDropsite, "force": false });
},
"OutOfRange": function(msg) {