add more errors
This commit is contained in:
parent
1744be7bdd
commit
3a8dcf284a
3 changed files with 69 additions and 1 deletions
|
|
@ -573,14 +573,23 @@ void CConfigManager::handleAnimation(const std::string& command, const std::stri
|
|||
// on/off
|
||||
PANIM->second.internalEnabled = curitem == "1";
|
||||
|
||||
if (curitem != "0" && curitem != "1") {
|
||||
parseError = "invalid animation on/off state";
|
||||
}
|
||||
|
||||
nextItem();
|
||||
|
||||
// speed
|
||||
if (isNumber(curitem, true)) {
|
||||
PANIM->second.internalSpeed = std::stof(curitem);
|
||||
|
||||
if (PANIM->second.internalSpeed <= 0) {
|
||||
parseError = "invalid speed";
|
||||
PANIM->second.internalSpeed = 1.f;
|
||||
}
|
||||
} else {
|
||||
PANIM->second.internalSpeed = 10.f;
|
||||
parseError = "Invalid speed";
|
||||
parseError = "invalid speed";
|
||||
}
|
||||
|
||||
nextItem();
|
||||
|
|
@ -588,11 +597,23 @@ void CConfigManager::handleAnimation(const std::string& command, const std::stri
|
|||
// curve
|
||||
PANIM->second.internalBezier = curitem;
|
||||
|
||||
if (!g_pAnimationManager->bezierExists(curitem)) {
|
||||
parseError = "no such bezier";
|
||||
PANIM->second.internalBezier = "default";
|
||||
}
|
||||
|
||||
nextItem();
|
||||
|
||||
// style
|
||||
PANIM->second.internalStyle = curitem;
|
||||
|
||||
if (curitem != "") {
|
||||
const auto ERR = g_pAnimationManager->styleValidInConfigVar(ANIMNAME, curitem);
|
||||
|
||||
if (ERR != "")
|
||||
parseError = ERR;
|
||||
}
|
||||
|
||||
// now, check for children, recursively
|
||||
setAnimForChildren(&PANIM->second);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue