mirror of
https://github.com/vcmi/vcmi.git
synced 2025-09-16 09:26:28 +02:00
Quick fix for major spell configuration bug
* clean fix requires save format change
This commit is contained in:
@@ -980,7 +980,7 @@ CSpell * CSpellHandler::loadFromJson(const JsonNode & json)
|
||||
if(usePowerAsValue)
|
||||
b->val = levelPower;
|
||||
|
||||
levelObject.effects.push_back(*b);
|
||||
levelObject.effectsTmp.push_back(b);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -994,8 +994,17 @@ void CSpellHandler::afterLoadFinalization()
|
||||
for(auto spell: objects)
|
||||
{
|
||||
for(auto & level: spell->levels)
|
||||
{
|
||||
for(Bonus * bonus : level.effectsTmp)
|
||||
{
|
||||
level.effects.push_back(*bonus);
|
||||
delete bonus;
|
||||
}
|
||||
level.effectsTmp.clear();
|
||||
|
||||
for(auto & bonus: level.effects)
|
||||
bonus.sid = spell->id;
|
||||
}
|
||||
spell->setup();
|
||||
}
|
||||
}
|
||||
|
@@ -154,6 +154,8 @@ public:
|
||||
|
||||
std::vector<Bonus> effects;
|
||||
|
||||
std::vector<Bonus *> effectsTmp; //TODO: this should replace effects
|
||||
|
||||
LevelInfo();
|
||||
~LevelInfo();
|
||||
|
||||
|
Reference in New Issue
Block a user