mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-04 09:59:44 -05:00
Avoid problems with exoplanets names that include whitespaces
This commit is contained in:
@@ -121,7 +121,6 @@ int addExoplanetSystem(lua_State* L) {
|
||||
|
||||
// If user have given name as in EOD, change it to speck-name
|
||||
std::string starNameSpeck = getSpeckStarName(starName);
|
||||
std::replace(starNameSpeck.begin(), starNameSpeck.end(), ' ', '_');
|
||||
|
||||
std::ifstream data(
|
||||
absPath("${MODULE_EXOPLANETS}/expl_data.bin"),
|
||||
@@ -214,6 +213,7 @@ int addExoplanetSystem(lua_State* L) {
|
||||
starToSunVec.z
|
||||
);
|
||||
|
||||
// Avoid whitespaces in identifiers
|
||||
std::replace(starNameSpeck.begin(), starNameSpeck.end(), ' ', '_');
|
||||
|
||||
const std::string starParent = "{"
|
||||
@@ -371,6 +371,9 @@ int addExoplanetSystem(lua_State* L) {
|
||||
const float semiMajorAxisInMeter = planet.A * distanceconstants::AstronomicalUnit;
|
||||
const float semiMajorAxisInKm = semiMajorAxisInMeter * 0.001f;
|
||||
|
||||
// Avoid whitespace in identifier
|
||||
std::replace(planetName.begin(), planetName.end(), ' ', '_');
|
||||
|
||||
const std::string planetNode = "{"
|
||||
"Identifier = '" + planetName + "',"
|
||||
"Parent = '" + starNameSpeck + "',"
|
||||
|
||||
Reference in New Issue
Block a user