Fix scissoring for LocalPlayer != null.

This commit is contained in:
Paul Chote
2010-11-26 12:58:35 +13:00
parent 84fd45ad69
commit a3861823c9

View File

@@ -52,7 +52,8 @@ namespace OpenRA.Graphics
{ {
var r = (world.LocalPlayer != null && !world.LocalPlayer.Shroud.Disabled && world.LocalPlayer.Shroud.Bounds.HasValue)? var r = (world.LocalPlayer != null && !world.LocalPlayer.Shroud.Disabled && world.LocalPlayer.Shroud.Bounds.HasValue)?
world.LocalPlayer.Shroud.Bounds.Value : world.Map.Bounds; world.LocalPlayer.Shroud.Bounds.Value : world.Map.Bounds;
r.Intersect(world.Map.Bounds);
var left = (int)(Game.CellSize * r.Left - Game.viewport.Location.X); var left = (int)(Game.CellSize * r.Left - Game.viewport.Location.X);
var top = (int)(Game.CellSize * r.Top - Game.viewport.Location.Y); var top = (int)(Game.CellSize * r.Top - Game.viewport.Location.Y);
var right = left + (int)(Game.CellSize * r.Width); var right = left + (int)(Game.CellSize * r.Width);