From 9b7bb532870dfb3a6dbe8d2de7973816ad331b97 Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Wed, 10 Apr 2013 21:42:30 +1200 Subject: [PATCH] LocalPlayer.Shroud is never the right shroud. --- .../Widgets/CncWorldInteractionControllerWidget.cs | 2 +- OpenRA.Mods.RA/Move/Mobile.cs | 4 ++-- OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs b/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs index 10a0f5ec7c..107d1768c5 100644 --- a/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs +++ b/OpenRA.Mods.Cnc/Widgets/CncWorldInteractionControllerWidget.cs @@ -66,7 +66,7 @@ namespace OpenRA.Mods.Cnc.Widgets if (!world.Map.IsInMap(cell)) return; - if (world.LocalPlayer != null && !world.LocalPlayer.Shroud.IsExplored(cell)) + if (world.ShroudObscures(cell)) { TooltipType = WorldTooltipType.Unexplored; return; diff --git a/OpenRA.Mods.RA/Move/Mobile.cs b/OpenRA.Mods.RA/Move/Mobile.cs index 63744d9776..86b1757737 100755 --- a/OpenRA.Mods.RA/Move/Mobile.cs +++ b/OpenRA.Mods.RA/Move/Mobile.cs @@ -485,10 +485,10 @@ namespace OpenRA.Mods.RA.Move IsQueued = forceQueued; cursor = "move"; - if (self.World.LocalPlayer.Shroud.IsExplored(location)) + if (self.Owner.Shroud.IsExplored(location)) cursor = self.World.GetTerrainInfo(location).CustomCursor ?? cursor; - if (!self.World.Map.IsInMap(location) || (self.World.LocalPlayer.Shroud.IsExplored(location) && + if (!self.World.Map.IsInMap(location) || (self.Owner.Shroud.IsExplored(location) && unitType.MovementCostForCell(self.World, location) == int.MaxValue)) cursor = "move-blocked"; diff --git a/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs b/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs index b52b092474..4326041e09 100755 --- a/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs +++ b/OpenRA.Mods.RA/Widgets/WorldTooltipWidget.cs @@ -31,9 +31,10 @@ namespace OpenRA.Mods.RA.Widgets return; var cell = Game.viewport.ViewToWorld(Viewport.LastMousePos); - if (!world.Map.IsInMap(cell)) return; + if (!world.Map.IsInMap(cell)) + return; - if (world.LocalPlayer != null && world.ShroudObscures(cell)) + if (world.ShroudObscures(cell)) { var utext = "Unexplored Terrain"; var usz = Game.Renderer.Fonts["Bold"].Measure(utext) + new int2(20, 24);