Merge branch 'master' of https://git.teknik.io/scuti/reflex2q3
This commit is contained in:
@@ -466,10 +466,9 @@ EntityConverter::convertTarget(const std::vector<std::string> &lines) const
|
||||
//position and name required, angles optional
|
||||
std::string coords[3] = {"0.0", "0.0", "0.0"};
|
||||
std::string targetName;
|
||||
std::string angle;
|
||||
std::string angle = "0.0";
|
||||
std::string trash;
|
||||
bool haveName = false;
|
||||
bool haveAngle = false;
|
||||
|
||||
|
||||
if ( lines.size() < 3 ) {
|
||||
@@ -504,7 +503,6 @@ EntityConverter::convertTarget(const std::vector<std::string> &lines) const
|
||||
throw std::runtime_error(
|
||||
makeErrorMessage( "error: Target entity requires target angle if specified", lines ));
|
||||
}
|
||||
haveAngle = true;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -538,12 +536,10 @@ EntityConverter::convertTarget(const std::vector<std::string> &lines) const
|
||||
targetStream << "\"targetname\" \"" << targetName << "\"" << std::endl;
|
||||
convertedLines.push_back ( targetStream.str() );
|
||||
|
||||
// Write angle only if position and name exist
|
||||
if ( haveAngle ) {
|
||||
std::stringstream angleStream;
|
||||
angleStream << "\"angle\" \"" << adjustAngleForHandedness(angle) << "\"" << std::endl;
|
||||
convertedLines.push_back( angleStream.str() );
|
||||
}
|
||||
// write angle every time
|
||||
std::stringstream angleStream;
|
||||
angleStream << "\"angle\" \"" << adjustAngleForHandedness(angle) << "\"" << std::endl;
|
||||
convertedLines.push_back( angleStream.str() );
|
||||
return convertedLines;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user