mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-12-25 06:05:45 +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:
parent
7039f1d2cc
commit
54199272e8
2 changed files with 18 additions and 4 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -1083,7 +1083,7 @@ public:
|
|||
|
||||
void applyIngredientEffects(IngredientData *data);
|
||||
|
||||
void loadIngredientData();
|
||||
void loadIngredientData(const std::string &file);
|
||||
bool hasIngredients() const { return !ingredients.empty(); }
|
||||
IngredientDatas::size_type ingredientCount() const { return ingredients.size(); }
|
||||
IngredientType getIngredientTypeFromName(const std::string &name) const;
|
||||
|
|
Loading…
Reference in a new issue