EntityConverter::convertTarget made safer
This commit is contained in:
1 parent
0b6254da89
commit
991cb4d02a
1 file changed
+5
-1
@@ -412,6 +412,7 @@ EntityConverter::convertTarget(std::vector<std::string> &lines)
|
||||
bool haveName = false;
|
||||
bool haveAngle = false;
|
||||
|
||||
|
||||
if ( lines.size() < 3 ) {
|
||||
throw std::runtime_error("error: Target entity requires at least 3 lines");
|
||||
}
|
||||
@@ -469,9 +470,12 @@ EntityConverter::convertTarget(std::vector<std::string> &lines)
|
||||
oss3 << "\"angle\" \"" << angle << "\"\n";
|
||||
convertedLines.push_back (oss3.str() );
|
||||
}
|
||||
return convertedLines;
|
||||
}
|
||||
else {
|
||||
throw std::runtime_error("error: Target entity requires position coordinates and targetname");
|
||||
}
|
||||
|
||||
return convertedLines;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user