Skip to content

Commit b4fd079

Browse files
committed
Fix builder
1 parent 142a8c0 commit b4fd079

6 files changed

Lines changed: 11 additions & 18 deletions

File tree

‎src/Engine/Game.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -465,10 +465,10 @@ void Game::loadLanguage(const std::string &filename)
465465
throw Exception(path + ": " + std::string(e.what()));
466466
}
467467

468-
std::vector<ModInfo> activeMods = Options::getActiveMods();
469-
for (std::vector<ModInfo>::const_iterator i = activeMods.begin(); i != activeMods.end(); ++i)
468+
std::vector<const ModInfo*> activeMods = Options::getActiveMods();
469+
for (std::vector<const ModInfo*>::const_iterator i = activeMods.begin(); i != activeMods.end(); ++i)
470470
{
471-
std::string file = i->getPath() + ss.str();
471+
std::string file = (*i)->getPath() + ss.str();
472472
if (CrossPlatform::fileExists(file))
473473
{
474474
_lang->load(file);

‎src/Engine/ModInfo.cpp‎

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,6 @@ ModInfo::ModInfo(const std::string &path) :
3232
// empty
3333
}
3434

35-
ModInfo::~ModInfo()
36-
{
37-
// empty
38-
}
39-
4035
void ModInfo::load(const std::string &filename)
4136
{
4237
YAML::Node doc = YAML::LoadFile(filename);

‎src/Engine/ModInfo.h‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ class ModInfo
3636
public:
3737
/// Creates default metadata for a mod at the specified path.
3838
ModInfo(const std::string &path);
39-
/// Cleans up.
40-
virtual ~ModInfo();
4139
/// Loads the metadata from YAML.
4240
void load(const std::string &filename);
4341
/// Gets the path where this mod resides on disk.

‎src/Engine/Options.cpp‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1075,15 +1075,15 @@ const std::vector<OptionInfo> &getOptionInfo()
10751075
* @sa ModInfo::canActivate
10761076
* @return List of info for the active mods.
10771077
*/
1078-
std::vector<ModInfo> getActiveMods()
1078+
std::vector<const ModInfo *> getActiveMods()
10791079
{
1080-
std::vector<ModInfo> activeMods;
1080+
std::vector<const ModInfo*> activeMods;
10811081
for (std::vector< std::pair<std::string, bool> >::iterator i = mods.begin(); i != mods.end(); ++i)
10821082
{
10831083
if (i->second)
10841084
{
1085-
ModInfo info = _modInfos.find(i->first)->second;
1086-
if (info.canActivate(_masterMod))
1085+
const ModInfo *info = &_modInfos.at(i->first);
1086+
if (info->canActivate(_masterMod))
10871087
{
10881088
activeMods.push_back(info);
10891089
}

‎src/Engine/Options.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ namespace Options
108108
/// Refreshes the mods and filemaps.
109109
void updateMods();
110110
/// Gets the list of currently active mods.
111-
std::vector<ModInfo> getActiveMods();
111+
std::vector<const ModInfo*> getActiveMods();
112112
}
113113

114114
}

‎src/Savegame/SavedGame.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -595,11 +595,11 @@ void SavedGame::save(const std::string &filename) const
595595
}
596596

597597
// only save mods that work with the current master
598-
std::vector<ModInfo> activeMods = Options::getActiveMods();
598+
std::vector<const ModInfo*> activeMods = Options::getActiveMods();
599599
std::vector<std::string> modsList;
600-
for (std::vector<ModInfo>::const_iterator i = activeMods.begin(); i != activeMods.end(); ++i)
600+
for (std::vector<const ModInfo*>::const_iterator i = activeMods.begin(); i != activeMods.end(); ++i)
601601
{
602-
modsList.push_back(i->getId() + " ver: " + i->getVersion());
602+
modsList.push_back((*i)->getId() + " ver: " + (*i)->getVersion());
603603
}
604604
brief["mods"] = modsList;
605605
if (_ironman)

0 commit comments

Comments
 (0)