Make Cargo and Carryall conditional.
This commit is contained in:
committed by
Gustas
parent
a14cc8cc4d
commit
98896f9a75
@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
protected override void OnFirstRun(Actor self)
|
||||
{
|
||||
// The cargo might have become invalid while we were moving towards it.
|
||||
if (cargo.IsDead || carryable.IsTraitDisabled || !cargo.AppearsFriendlyTo(self))
|
||||
if (cargo.IsDead || carryable.IsTraitDisabled || carryall.IsTraitDisabled || !cargo.AppearsFriendlyTo(self))
|
||||
return;
|
||||
|
||||
if (carryall.ReserveCarryable(self, cargo))
|
||||
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
if (IsCanceling)
|
||||
return true;
|
||||
|
||||
if (cargo.IsDead || carryable.IsTraitDisabled || !cargo.AppearsFriendlyTo(self) || cargo != carryall.Carryable)
|
||||
if (cargo.IsDead || carryable.IsTraitDisabled || carryall.IsTraitDisabled || !cargo.AppearsFriendlyTo(self) || cargo != carryall.Carryable)
|
||||
{
|
||||
Cancel(self, true);
|
||||
return false;
|
||||
@@ -160,7 +160,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
protected override void OnFirstRun(Actor self)
|
||||
{
|
||||
// The cargo might have become invalid while we were moving towards it.
|
||||
if (cargo == null || cargo.IsDead || carryable.IsTraitDisabled || carryall.Carryable != cargo || !cargo.AppearsFriendlyTo(self))
|
||||
if (cargo == null || cargo.IsDead || carryable.IsTraitDisabled || carryall.IsTraitDisabled || carryall.Carryable != cargo || !cargo.AppearsFriendlyTo(self))
|
||||
return;
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
|
||||
Reference in New Issue
Block a user