From ee84868b7da7f261e18201b62a4a1b1d7f2f790e Mon Sep 17 00:00:00 2001 From: uramer Date: Fri, 20 Mar 2020 22:28:00 +0100 Subject: [PATCH] [Client] Fix double summoning magical effects --- apps/openmw/mwmp/ObjectList.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwmp/ObjectList.cpp b/apps/openmw/mwmp/ObjectList.cpp index c917afcc7..9993be3a0 100644 --- a/apps/openmw/mwmp/ObjectList.cpp +++ b/apps/openmw/mwmp/ObjectList.cpp @@ -495,7 +495,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);