]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/mods.cpp
Translated using Weblate (Korean)
[dragonfireclient.git] / src / mods.cpp
index 7d6b4f5f7686f64389e7d2c49f216e3d9329afc2..a81dd46045d48fdc7d66ce6875052f9fd451723a 100644 (file)
@@ -17,15 +17,15 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
+#include <cctype>
+#include <fstream>
 #include "mods.h"
-#include "main.h"
 #include "filesys.h"
 #include "strfnd.h"
 #include "log.h"
 #include "subgame.h"
 #include "settings.h"
 #include "strfnd.h"
-#include <cctype>
 #include "convert_json.h"
 
 static bool parseDependsLine(std::istream &is,
@@ -47,6 +47,11 @@ static bool parseDependsLine(std::istream &is,
 void parseModContents(ModSpec &spec)
 {
        // NOTE: this function works in mutual recursion with getModsInPath
+       Settings info;
+       info.readConfigFile((spec.path+DIR_DELIM+"mod.conf").c_str());
+
+       if (info.exists("name"))
+               spec.name = info.get("name");
 
        spec.depends.clear();
        spec.optdepends.clear();
@@ -240,7 +245,7 @@ void ModConfiguration::addMods(std::vector<ModSpec> new_mods)
                for(std::vector<ModSpec>::const_iterator it = new_mods.begin();
                                it != new_mods.end(); ++it){
                        const ModSpec &mod = *it;
-                       if(mod.part_of_modpack != want_from_modpack)
+                       if(mod.part_of_modpack != (bool)want_from_modpack)
                                continue;
                        if(existing_mods.count(mod.name) == 0){
                                // GOOD CASE: completely new mod.