Merge branch '0.7.1-summons-ordering' into 0.7.1

This commit is contained in:
David Cernat 2020-03-22 17:29:01 +02:00
commit 907c5fc6de
2 changed files with 4 additions and 2 deletions

View File

@ -751,7 +751,7 @@ namespace MWMechanics
{
for (std::map<CreatureStats::SummonKey, int>::iterator it = mSummonedCreatures.begin(); it != mSummonedCreatures.end(); )
{
if (Misc::StringUtils::ciEqual(getSummonedCreature(it->first.first), refId))
if (Misc::StringUtils::ciEqual(getSummonedCreature(it->first.first), refId) && it->second == -1)
{
it->second = actorId;
break;

View File

@ -499,7 +499,9 @@ void ObjectList::spawnObjects(MWWorld::CellStore* cellStore)
LOG_APPEND(TimedLog::LOG_INFO, "-- adding active spell to master with id %s, effect %i, duration %f",
baseObject.summonSpellId.c_str(), baseObject.summonEffectId, baseObject.summonDuration);
masterCreatureStats.getActiveSpells().addSpell(baseObject.summonSpellId, false, activeEffects, "", masterCreatureStats.getActorId());
auto activeSpells = masterCreatureStats.getActiveSpells();
if (!activeSpells.isSpellActive(baseObject.summonSpellId))
activeSpells.addSpell(baseObject.summonSpellId, false, activeEffects, "", masterCreatureStats.getActorId());
LOG_APPEND(TimedLog::LOG_INFO, "-- setting summoned creatureActorId for %i-%i to %i",
newPtr.getCellRef().getRefNum(), newPtr.getCellRef().getMpNum(), creatureActorId);