warn about incorrect bezier args

This commit is contained in:
Vaxry 2022-08-09 18:15:37 +02:00
parent e2f61e267e
commit a6d4a4d5f3
1 changed files with 11 additions and 0 deletions

View File

@ -512,13 +512,24 @@ void CConfigManager::handleBezier(const std::string& command, const std::string&
std::string bezierName = curitem;
nextItem();
if (curitem == "")
parseError = "too few arguments";
float p1x = std::stof(curitem);
nextItem();
if (curitem == "")
parseError = "too few arguments";
float p1y = std::stof(curitem);
nextItem();
if (curitem == "")
parseError = "too few arguments";
float p2x = std::stof(curitem);
nextItem();
if (curitem == "")
parseError = "too few arguments";
float p2y = std::stof(curitem);
nextItem();
if (curitem != "")
parseError = "too many arguments";
g_pAnimationManager->addBezierWithName(bezierName, Vector2D(p1x, p1y), Vector2D(p2x, p2y));
}