EntityConverter::convertTarget made safer
This commit is contained in:
parent
0b6254da89
commit
991cb4d02a
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user