Index: binaries/data/mods/public/simulation/components/GuiInterface.js
===================================================================
--- binaries/data/mods/public/simulation/components/GuiInterface.js	(revision 10569)
+++ binaries/data/mods/public/simulation/components/GuiInterface.js	(working copy)
@@ -255,7 +255,7 @@
 	}
 
 	var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
-	ret.visibility = cmpRangeManager.GetLosVisibility(ent, player);
+	ret.visibility = cmpRangeManager.GetLosVisibility(ent, player, false);
 
 	return ret;
 };
@@ -508,9 +508,11 @@
 			pos.SetYRotation(cmd.angle);
 		}
 
-		// Check whether it's in a visible region
+		// Check whether it's in a visible or fogged region
+		//	tell GetLosVisibility to force RetainInFog because preview entities set this to false,
+		//	which would show them as hidden instead of fogged
 		var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
-		var visible = (cmpRangeManager && cmpRangeManager.GetLosVisibility(ent, player) == "visible");
+		var visible = (cmpRangeManager && cmpRangeManager.GetLosVisibility(ent, player, true) != "hidden");
 		var validPlacement = false;
 		
 		if (visible)
Index: binaries/data/mods/public/simulation/components/UnitAI.js
===================================================================
--- binaries/data/mods/public/simulation/components/UnitAI.js	(revision 10570)
+++ binaries/data/mods/public/simulation/components/UnitAI.js	(working copy)
@@ -1945,7 +1945,7 @@
 	if (!cmpRangeManager)
 		return false;
 
-	if (cmpRangeManager.GetLosVisibility(target, cmpOwnership.GetOwner()) == "hidden")
+	if (cmpRangeManager.GetLosVisibility(target, cmpOwnership.GetOwner(), false) == "hidden")
 		return false;
 
 	// Either visible directly, or visible in fog
Index: binaries/data/mods/public/simulation/helpers/Commands.js
===================================================================
--- binaries/data/mods/public/simulation/helpers/Commands.js	(revision 10570)
+++ binaries/data/mods/public/simulation/helpers/Commands.js	(working copy)
@@ -216,9 +216,9 @@
 		// TODO: AI has no visibility info
 		if (!cmpPlayer.IsAI())
 		{
-			// Check whether it's in a visible region
+			// Check whether it's in a visible or fogged region
 			var cmpRangeManager = Engine.QueryInterface(SYSTEM_ENTITY, IID_RangeManager);
-			var visible = (cmpRangeManager.GetLosVisibility(ent, player) == "visible");
+			var visible = (cmpRangeManager.GetLosVisibility(ent, player, true) != "hidden");
 			if (!visible)
 			{
 				if (g_DebugCommands)
Index: source/simulation2/components/CCmpRangeManager.cpp
===================================================================
--- source/simulation2/components/CCmpRangeManager.cpp	(revision 10569)
+++ source/simulation2/components/CCmpRangeManager.cpp	(working copy)
@@ -872,7 +872,7 @@
 			return CLosQuerier(player, m_LosState, m_TerrainVerticesPerSide);
 	}
 
-	virtual ELosVisibility GetLosVisibility(entity_id_t ent, player_id_t player)
+	virtual ELosVisibility GetLosVisibility(entity_id_t ent, player_id_t player, bool forceRetainInFog)
 	{
 		// (We can't use m_EntityData since this needs to handle LOCAL entities too)
 
@@ -906,7 +906,7 @@
 		if (los.IsExplored(i, j))
 		{
 			CmpPtr<ICmpVision> cmpVision(GetSimContext(), ent);
-			if (!cmpVision.null() && cmpVision->GetRetainInFog())
+			if (forceRetainInFog || (!cmpVision.null() && cmpVision->GetRetainInFog()))
 				return VIS_FOGGED;
 		}
 
Index: source/simulation2/components/ICmpRangeManager.cpp
===================================================================
--- source/simulation2/components/ICmpRangeManager.cpp	(revision 10569)
+++ source/simulation2/components/ICmpRangeManager.cpp	(working copy)
@@ -21,9 +21,9 @@
 
 #include "simulation2/system/InterfaceScripted.h"
 
-std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player)
+std::string ICmpRangeManager::GetLosVisibility_wrapper(entity_id_t ent, int player, bool forceRetainInFog)
 {
-	ELosVisibility visibility = GetLosVisibility(ent, player);
+	ELosVisibility visibility = GetLosVisibility(ent, player, forceRetainInFog);
 	switch (visibility)
 	{
 	case VIS_HIDDEN: return "hidden";
@@ -43,7 +43,7 @@
 DEFINE_INTERFACE_METHOD_1("GetEntitiesByPlayer", std::vector<entity_id_t>, ICmpRangeManager, GetEntitiesByPlayer, player_id_t)
 DEFINE_INTERFACE_METHOD_1("SetDebugOverlay", void, ICmpRangeManager, SetDebugOverlay, bool)
 DEFINE_INTERFACE_METHOD_2("SetLosRevealAll", void, ICmpRangeManager, SetLosRevealAll, player_id_t, bool)
-DEFINE_INTERFACE_METHOD_2("GetLosVisibility", std::string, ICmpRangeManager, GetLosVisibility_wrapper, entity_id_t, player_id_t)
+DEFINE_INTERFACE_METHOD_3("GetLosVisibility", std::string, ICmpRangeManager, GetLosVisibility_wrapper, entity_id_t, player_id_t, bool)
 DEFINE_INTERFACE_METHOD_1("SetLosCircular", void, ICmpRangeManager, SetLosCircular, bool)
 DEFINE_INTERFACE_METHOD_0("GetLosCircular", bool, ICmpRangeManager, GetLosCircular)
 DEFINE_INTERFACE_METHOD_1("GetPercentMapExplored", i32, ICmpRangeManager, GetPercentMapExplored, player_id_t)
Index: source/simulation2/components/ICmpRangeManager.h
===================================================================
--- source/simulation2/components/ICmpRangeManager.h	(revision 10569)
+++ source/simulation2/components/ICmpRangeManager.h	(working copy)
@@ -260,14 +260,17 @@
 	 * Returns the visibility status of the given entity, with respect to the given player.
 	 * Returns VIS_HIDDEN if the entity doesn't exist or is not in the world.
 	 * This respects the GetLosRevealAll flag.
+	 * If forceRetainInFog is true, the visibility acts as if CCmpVision's RetainInFog flag were set.
+	 * TODO: This is a hack to allow preview entities in FoW to return fogged instead of hidden,
+	 *	see http://trac.wildfiregames.com/ticket/958
 	 */
-	virtual ELosVisibility GetLosVisibility(entity_id_t ent, player_id_t player) = 0;
+	virtual ELosVisibility GetLosVisibility(entity_id_t ent, player_id_t player, bool forceRetainInFog = false) = 0;
 
 	/**
 	 * GetLosVisibility wrapped for script calls.
 	 * Returns "hidden", "fogged" or "visible".
 	 */
-	std::string GetLosVisibility_wrapper(entity_id_t ent, player_id_t player);
+	std::string GetLosVisibility_wrapper(entity_id_t ent, player_id_t player, bool forceRetainInFog);
 
 	/**
 	 * Set whether the whole map should be made visible to the given player.
