From 1df018f52628d4af7d73e1e71d9b98d8310824ea Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Sat, 4 Oct 2014 09:48:10 +1300 Subject: [PATCH] Update CurrentAdjacentCells when actor is added to the world. Fixes #6633. --- OpenRA.Mods.RA/Cargo.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.RA/Cargo.cs index 967c8350ca..0ba8ecc78f 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.RA/Cargo.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA public object Create(ActorInitializer init) { return new Cargo(init, this); } } - public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyKilled, INotifyCapture, ITick, INotifySold, IDisableMove + public class Cargo : IPips, IIssueOrder, IResolveOrder, IOrderVoice, INotifyKilled, INotifyCapture, INotifyAddedToWorld, ITick, INotifySold, IDisableMove { public readonly CargoInfo Info; readonly Actor self; @@ -256,6 +256,13 @@ namespace OpenRA.Mods.RA }); } + public void AddedToWorld(Actor self) + { + // Force location update to avoid issues when initial spawn is outside map + currentCell = self.Location; + CurrentAdjacentCells = GetAdjacentCells(); + } + bool initialized; public void Tick(Actor self) {