Log missing MissileType definition. (and ShowLoadProgress when loading succeed).

This commit is contained in:
Joris 2012-12-10 16:59:29 +01:00
parent 7458218ea0
commit 1def6cf12d
2 changed files with 21 additions and 1 deletions

View file

@ -46,6 +46,7 @@ class MissileConfig
public:
MissileConfig() : Missile(NULL) {}
bool MapMissileNoLog();
bool MapMissile();
public:

View file

@ -34,11 +34,30 @@
#include "missileconfig.h"
#include "missile.h"
#include "translate.h"
#include "ui.h"
bool MissileConfig::MapMissile()
bool MissileConfig::MapMissileNoLog()
{
if (this->Name.empty()) {
this->Missile = NULL;
return true;
}
this->Missile = MissileTypeByIdent(this->Name);
return this->Missile != NULL;
}
bool MissileConfig::MapMissile()
{
if (MapMissileNoLog() == true) {
if (this->Name.empty() == false) {
ShowLoadProgress(_("Missile %s"), this->Name.c_str());
}
return true;
} else {
fprintf(stderr, _("Can't find missile %s\n"), this->Name.c_str());
return false;
}
}
//@}