fix a NullReferenceException in preview.Map

This commit is contained in:
Matthias Mailänder
2014-07-06 15:36:46 +02:00
parent e3e5de2b59
commit d4627479b5

View File

@@ -132,7 +132,8 @@ namespace OpenRA.Widgets
public int2 ConvertToPreview(CPos cell)
{
var preview = Preview();
var point = Map.CellToMap(preview.Map.TileShape, cell);
var tileShape = Game.modData.Manifest.TileShape;
var point = Map.CellToMap(tileShape, cell);
var dx = (int)(previewScale * (point.X - preview.Bounds.Left));
var dy = (int)(previewScale * (point.Y - preview.Bounds.Top));
return new int2(mapRect.X + dx, mapRect.Y + dy);