diff --git a/OpenRa.Game/Traits/Chronoshiftable.cs b/OpenRa.Game/Traits/Chronoshiftable.cs index 98dc29d28c..7f86dca0be 100644 --- a/OpenRa.Game/Traits/Chronoshiftable.cs +++ b/OpenRa.Game/Traits/Chronoshiftable.cs @@ -53,8 +53,20 @@ namespace OpenRa.Game.Traits // Set up return-to-sender info chronoshiftOrigin = self.Location; chronoshiftReturnTicks = (int)(Rules.General.ChronoDuration * 60 * 25); - - // TODO: Kill cargo if Rules.General.ChronoKillCargo says so + + var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains()).FirstOrDefault(); + + // Kill cargo + if (Rules.General.ChronoKillCargo && self.traits.Contains()) + { + var cargo = self.traits.Get(); + while (!cargo.IsEmpty(self)) + { + if (chronosphere != null) + chronosphere.Owner.Kills++; + cargo.Unload(self); + } + } // Set up the teleport Game.controller.CancelInputMode(); @@ -66,7 +78,6 @@ namespace OpenRa.Game.Traits a.traits.Get().DoChronoshift(); // Play chronosphere active anim - var chronosphere = Game.world.Actors.Where(a => a.Owner == order.Subject.Owner && a.traits.Contains()).FirstOrDefault(); if (chronosphere != null) chronosphere.traits.Get().PlayCustomAnim(chronosphere, "active"); }