- code cleanup based on cppcheck report

This commit is contained in:
Mark Vejvoda 2012-04-05 03:53:59 +00:00
parent 83d2474ded
commit 2ab041813f
4 changed files with 1 additions and 21 deletions

View File

@ -677,41 +677,23 @@ string ScriptManager::wrapString(const string &str, int wrapCount){
void ScriptManager::networkShowMessageForFaction(const string &text, const string &header,int factionIndex) {
ScriptManager_STREFLOP_Wrapper streflopWrapper;
Lang &lang= Lang::getInstance();
messageQueue.push_back(ScriptManagerMessage(text, header, factionIndex));
onMessageBoxOk(false);
// if(factionIndex == this->world->getThisFactionIndex()) {
// messageBox.setEnabled(true);
// messageBox.setText(wrapString(lang.getScenarioString(messageQueue.front().getText()), messageWrapCount));
// messageBox.setHeader(lang.getScenarioString(messageQueue.front().getHeader()));
// }
}
void ScriptManager::networkShowMessageForTeam(const string &text, const string &header,int teamIndex) {
ScriptManager_STREFLOP_Wrapper streflopWrapper;
Lang &lang= Lang::getInstance();
// Team indexes are 0 based internally (but 1 based in the lua script) so convert
teamIndex--;
messageQueue.push_back(ScriptManagerMessage(text, header, -1, teamIndex));
onMessageBoxOk(false);
// if(teamIndex == this->world->getThisTeamIndex()) {
// messageBox.setEnabled(true);
// messageBox.setText(wrapString(lang.getScenarioString(messageQueue.front().getText()), messageWrapCount));
// messageBox.setHeader(lang.getScenarioString(messageQueue.front().getHeader()));
// }
}
void ScriptManager::showMessage(const string &text, const string &header){
ScriptManager_STREFLOP_Wrapper streflopWrapper;
Lang &lang= Lang::getInstance();
messageQueue.push_back(ScriptManagerMessage(text, header));
onMessageBoxOk(false);
// messageBox.setEnabled(true);
// messageBox.setText(wrapString(lang.getScenarioString(messageQueue.front().getText()), messageWrapCount));
// messageBox.setHeader(lang.getScenarioString(messageQueue.front().getHeader()));
}
void ScriptManager::clearDisplayText(){

View File

@ -1176,7 +1176,6 @@ bool Gui::computeTarget(const Vec2i &screenPos, Vec2i &targetPos, const Unit *&t
else{
targetUnit= NULL;
if(renderer.computePosition(screenPos, targetPos)){
const Object* resourceObject;
validPosObjWorld= true;
posObjWorld= targetPos;

View File

@ -2434,10 +2434,8 @@ void runTilesetValidationReport(int argc, char** argv) {
//disableBacktrace=true;
printf("====== Started Validation ======\n");
bool purgeDuplicateFiles = false;
bool showDuplicateFiles = true;
bool purgeUnusedFiles = false;
bool svnPurgeFiles = false;
double purgedMegaBytes=0;
Config &config = Config::getInstance();

View File

@ -38,6 +38,7 @@ ResourceType::ResourceType() {
defResPerPatch=0;
recoup_cost = false;
model = NULL;
displayInHud = false;
}
ResourceType::~ResourceType(){