Update CurrentAdjacentCells when actor is added to the world. Fixes #6633.
This commit is contained in:
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user