From ba89eaa50d475abbf928f296447d81a5cd7191f3 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Mon, 6 Oct 2014 08:20:02 +1300 Subject: [PATCH] Revert cachedLocation change that caused issues with transports. This partially reverts commit 2f5ac1a360342e180f24ac2289cf34fcb0b21045. --- OpenRA.Mods.RA/Cargo.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.RA/Cargo.cs b/OpenRA.Mods.RA/Cargo.cs index 9f2b6f46bf..616d222021 100644 --- a/OpenRA.Mods.RA/Cargo.cs +++ b/OpenRA.Mods.RA/Cargo.cs @@ -36,10 +36,10 @@ namespace OpenRA.Mods.RA readonly List cargo = new List(); readonly HashSet reserves = new HashSet(); - CPos cachedLocation; int totalWeight = 0; int reservedWeight = 0; + CPos currentCell; public IEnumerable CurrentAdjacentCells { get; private set; } public bool Unloading { get; internal set; } public IEnumerable Passengers { get { return cargo; } } @@ -269,7 +269,7 @@ namespace OpenRA.Mods.RA public void AddedToWorld(Actor self) { // Force location update to avoid issues when initial spawn is outside map - cachedLocation = self.Location; + currentCell = self.Location; CurrentAdjacentCells = GetAdjacentCells(); } @@ -286,13 +286,13 @@ namespace OpenRA.Mods.RA foreach (var npe in self.TraitsImplementing()) npe.PassengerEntered(self, c); } - initialized = true; } - if (cachedLocation != self.Location) + var cell = self.World.Map.CellContaining(self.CenterPosition); + if (currentCell != cell) { - cachedLocation = self.Location; + currentCell = cell; CurrentAdjacentCells = GetAdjacentCells(); } }