problems found by coverity

This commit is contained in:
titiger
2014-11-10 21:53:10 +01:00
parent 49e55209da
commit d21f7bd976
2 changed files with 7 additions and 5 deletions

View File

@@ -2441,7 +2441,9 @@ void MenuStateCustomGame::update() {
if(this->autoloadScenarioName != "") { if(this->autoloadScenarioName != "") {
listBoxScenario.setSelectedItem(formatString(this->autoloadScenarioName),false); listBoxScenario.setSelectedItem(formatString(this->autoloadScenarioName),false);
lastSetChangedGameSettings = time(NULL); lastSetChangedGameSettings = time(NULL);
lastGameSettingsreceivedCount=serverInterface->getGameSettingsUpdateCount(); if(serverInterface != NULL){
lastGameSettingsreceivedCount=serverInterface->getGameSettingsUpdateCount();
}
if(listBoxScenario.getSelectedItem() != formatString(this->autoloadScenarioName)) { if(listBoxScenario.getSelectedItem() != formatString(this->autoloadScenarioName)) {
mainMessageBoxState=1; mainMessageBoxState=1;
showMessageBox( "Could not find scenario name: " + formatString(this->autoloadScenarioName), "Scenario Missing", false); showMessageBox( "Could not find scenario name: " + formatString(this->autoloadScenarioName), "Scenario Missing", false);

View File

@@ -705,15 +705,15 @@ XmlNode::XmlNode(xml_node<> *node, const std::map<string,string> &mapTagReplacem
if(node->type() == node_element && children.size() == 0) { if(node->type() == node_element && children.size() == 0) {
string xmlText = node->value(); string xmlText = node->value();
bool debugReplace = false; // bool debugReplace = false;
// if(xmlText.find("{SCENARIOPATH}") != string::npos) { // if(xmlText.find("{SCENARIOPATH}") != string::npos) {
// printf("\n----------------------\n** XML!! WILL REPLACE [%s]\n",xmlText.c_str()); // printf("\n----------------------\n** XML!! WILL REPLACE [%s]\n",xmlText.c_str());
// debugReplace = true; // debugReplace = true;
// } // }
Properties::applyTagsToValue(xmlText,&mapTagReplacementValues, skipUpdatePathClimbingParts); Properties::applyTagsToValue(xmlText,&mapTagReplacementValues, skipUpdatePathClimbingParts);
if(debugReplace) { // if(debugReplace) {
printf("\n\n** XML!! REPLACED WITH [%s]\n===================\n",xmlText.c_str()); // printf("\n\n** XML!! REPLACED WITH [%s]\n===================\n",xmlText.c_str());
} // }
text = xmlText; text = xmlText;
} }
} }