Error checking now active for start-ep

You can no longer have both start-value and start-percentage.
This commit is contained in:
Mike Hoffert 2014-07-19 10:31:57 -06:00
parent a65898571d
commit 94667b9ab9
1 changed files with 8 additions and 0 deletions

View File

@ -250,6 +250,14 @@ void UnitType::loaddd(int id,const string &dir, const TechTree *techTree,
}
addItemToVault(&(this->epRegeneration),this->epRegeneration);
// Check that we don't use both start-value and start-percentage, as they are mutually
// exclusive
if(parametersNode->getChild("max-ep")->hasAttribute("start-value") &&
parametersNode->getChild("max-ep")->hasAttribute("start-percentage")) {
throw megaglest_runtime_error("Unit " + name +
" has both start-value and start-percentage for EP", validationMode);
}
//startEpValue -- the *absolute* value to use for starting EP
if(parametersNode->getChild("max-ep")->hasAttribute("start-value")) {
//checkItemInVault(&(this->startEp),this->startEp);