Make Cargo and Carryall conditional.

This commit is contained in:
Matthias Mailänder
2023-07-25 21:43:23 +02:00
committed by Gustas
parent a14cc8cc4d
commit 98896f9a75
7 changed files with 47 additions and 27 deletions

View File

@@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Activities
// Make sure we can still enter the transport
// (but not before, because this may stop the actor in the middle of nowhere)
if (enterCargo == null || !passenger.Reserve(self, enterCargo))
if (enterCargo == null || enterCargo.IsTraitDisabled || !passenger.Reserve(self, enterCargo))
{
Cancel(self, true);
return false;
@@ -49,6 +49,12 @@ namespace OpenRA.Mods.Common.Activities
return true;
}
protected override void TickInner(Actor self, in Target target, bool targetIsDeadOrHiddenActor)
{
if (enterCargo != null && enterCargo.IsTraitDisabled)
Cancel(self, true);
}
protected override void OnEnterComplete(Actor self, Actor targetActor)
{
self.World.AddFrameEndTask(w =>