diff --git a/indra/newview/llagentui.cpp b/indra/newview/llagentui.cpp
index 97f7a107e7d04eba99f72fef05a3eb6cff47492c..10df3db8a590f10f560606102f4f56a80b79c67f 100755
--- a/indra/newview/llagentui.cpp
+++ b/indra/newview/llagentui.cpp
@@ -37,7 +37,6 @@
 #include "llviewerregion.h"
 #include "llviewerparcelmgr.h"
 #include "llvoavatarself.h"
-#include "llworldmap.h"
 #include "llslurl.h"
 
 //static
@@ -55,9 +54,8 @@ void LLAgentUI::buildSLURL(LLSLURL& slurl, const bool escaped /*= true*/)
 	if (regionp)
 	{
 		LLVector3d pos_global = gAgent.getPositionGlobal();
-		const LLSimInfo* sim = LLWorldMap::getInstance()->simInfoFromPosGlobal(pos_global);
-		pos_global[0] = fmod(pos_global[0], sim ? sim->getSizeX() : 256);
-		pos_global[1] = fmod(pos_global[1], sim ? sim->getSizeY() : 256);
+		pos_global[0] = fmod(pos_global[0], regionp->getWidth());
+		pos_global[1] = fmod(pos_global[1], regionp->getWidth());
 		return_slurl = LLSLURL(regionp->getHGGrid(), regionp->getName(), pos_global);
 	}
 	slurl = return_slurl;
diff --git a/indra/newview/llviewerregion.h b/indra/newview/llviewerregion.h
index 70f3a3fbd77d7efc56334638be84315676a5e138..a4344c3da42b7d98a1c5ac6555e6c23dc5999f03 100755
--- a/indra/newview/llviewerregion.h
+++ b/indra/newview/llviewerregion.h
@@ -230,7 +230,7 @@ public:
 
 	void setCacheID(const LLUUID& id);
 
-	F32	getWidth() const						{ return mWidth; }
+	F32	getWidth()						const { return mWidth; }
 
 	void idleUpdate(F32 max_update_time);
 	void lightIdleUpdate();