only check for an hg map server if in opensim, also guard against a potential crash

meow-7.2.2
Cinders 2013-08-14 15:56:38 -06:00
parent e7527618f0
commit 7b0a6717ce
1 changed files with 10 additions and 2 deletions

View File

@ -34,6 +34,7 @@
// <FS:CR> HG maps
#ifdef OPENSIM
#include "llviewernetwork.h"
#include "llviewerregion.h"
#include "llagent.h"
#endif // OPENSIM
@ -190,8 +191,15 @@ LLPointer<LLViewerFetchedTexture> LLWorldMipmap::loadObjectsTile(U32 grid_x, U32
// Get the grid coordinates
// <FS:CR> HG Maps
#ifdef OPENSIM
LLViewerRegion* region = gAgent.getRegion();
std::string hg_map = region->getHGMapServerURL();
std::string hg_map;
if (LLGridManager::getInstance()->isInOpenSim())
{
LLViewerRegion* region = gAgent.getRegion();
if (region)
{
hg_map = region->getHGMapServerURL();
}
}
std::string imageurl = hg_map.empty() ? gSavedSettings.getString("CurrentMapServerURL") : hg_map;
imageurl.append(llformat("map-%d-%d-%d-objects.jpg", level, grid_x, grid_y));
#else // !OPENSIM