1
0
Fork 0
mirror of https://github.com/AquariaOSE/Aquaria.git synced 2025-08-12 01:10:03 +00:00

If Aquaria is playing a mod, try to load the file "data/ingredients.txt"

in the mod first, then load the main ingredients file if nothing has been loaded

 (Original patch by Yogoda)
This commit is contained in:
fgenesis 2011-11-07 15:21:37 +01:00
parent 7039f1d2cc
commit 54199272e8
2 changed files with 18 additions and 4 deletions

View file

@ -895,7 +895,7 @@ void Continuity::clearIngredientData()
ingredientData.clear();
}
void Continuity::loadIngredientData()
void Continuity::loadIngredientData(const std::string &file)
{
std::string line, name, gfx, type, effects;
@ -916,7 +916,7 @@ void Continuity::loadIngredientData()
clearIngredientData();
recipes.clear();
std::ifstream in("data/ingredients.txt");
std::ifstream in(file.c_str());
bool recipes = false;
while (std::getline(in, line))
@ -3218,7 +3218,21 @@ void Continuity::reset()
foodSortType = 0;
loadIngredientData();
//load ingredients
ingredientDescriptions.clear();
ingredientData.clear();
recipes.clear();
if(dsq->mod.isActive())
{
//load mod ingredients
loadIngredientData(dsq->mod.getPath() + "data/ingredients.txt");
}
//load ingredients for the main game
if(ingredientData.empty() && recipes.empty())
loadIngredientData("data/ingredients.txt");
loadPetData();