Made relative infoURL relative to the current directory (the addon's dir)
instead of to the main data directory.ver1_5_1
parent
183091936b
commit
0647d52bca
|
@ -147,7 +147,18 @@ bool DeepSkyObject::load(AssociativeArray* params, const string& resPath)
|
|||
|
||||
string infoURL;
|
||||
if (params->getString("InfoURL", infoURL))
|
||||
{
|
||||
if (infoURL.find(':') == string::npos)
|
||||
{
|
||||
// Relative URL, the base directory is the current one,
|
||||
// not the main installation directory
|
||||
if (resPath[1] == ':')
|
||||
// Absolute Windows path, file:/// is required
|
||||
infoURL = "file:///" + resPath + "/" + infoURL;
|
||||
else
|
||||
infoURL = resPath + "/" + infoURL;
|
||||
}
|
||||
setInfoURL(infoURL);
|
||||
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -294,7 +294,19 @@ static Body* CreatePlanet(PlanetarySystem* system,
|
|||
|
||||
string infoURL;
|
||||
if (planetData->getString("InfoURL", infoURL))
|
||||
{
|
||||
if (infoURL.find(':') == string::npos)
|
||||
{
|
||||
// Relative URL, the base directory is the current one,
|
||||
// not the main installation directory
|
||||
if (path[1] == ':')
|
||||
// Absolute Windows path, file:/// is required
|
||||
infoURL = "file:///" + path + "/" + infoURL;
|
||||
else
|
||||
infoURL = path + "/" + infoURL;
|
||||
}
|
||||
body->setInfoURL(infoURL);
|
||||
}
|
||||
|
||||
double albedo = 0.5;
|
||||
if (planetData->getNumber("Albedo", albedo))
|
||||
|
|
Loading…
Reference in New Issue