Allow a carryable to change his destination after being reserved

This commit is contained in:
Matthijs Benschop
2014-12-21 23:03:29 +01:00
parent 30a5df46af
commit 0868558e94

View File

@@ -54,17 +54,18 @@ namespace OpenRA.Mods.D2k.Traits
void RequestTransport(CPos destination, Activity afterLandActivity) void RequestTransport(CPos destination, Activity afterLandActivity)
{ {
if (locked || Reserved) if (destination == CPos.Zero || (self.Location - destination).Length < info.MinDistance)
return; {
WantsTransport = false; // Be sure to cancel any pending transports
if (destination == CPos.Zero)
return;
if ((self.Location - destination).Length < info.MinDistance)
return; return;
}
Destination = destination; Destination = destination;
this.afterLandActivity = afterLandActivity; this.afterLandActivity = afterLandActivity;
if (locked || Reserved)
return;
WantsTransport = true; WantsTransport = true;
// Inform all idle carriers // Inform all idle carriers