Cache cell ramps to avoid repeated tileset lookups.

This commit is contained in:
Paul Chote
2020-05-04 00:20:48 +01:00
committed by atlimit8
parent 1354ffc32e
commit 4614f6febe
9 changed files with 37 additions and 56 deletions

View File

@@ -241,16 +241,8 @@ namespace OpenRA.Mods.Common.Traits
if (Info.CanDeployOnRamps)
return true;
var ramp = 0;
if (self.World.Map.Contains(location))
{
var tile = self.World.Map.Tiles[location];
var ti = self.World.Map.Rules.TileSet.GetTileInfo(tile);
if (ti != null)
ramp = ti.RampType;
}
return ramp == 0;
var map = self.World.Map;
return !map.Ramp.Contains(location) || map.Ramp[location] == 0;
}
void INotifyDeployComplete.FinishedDeploy(Actor self)