Update CurrentAdjacentCells when actor is added to the world. Fixes #6633.

This commit is contained in:
Paul Chote
2014-10-04 09:48:10 +13:00
parent beed736169
commit 1df018f526

View File

@@ -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)
{