From 8c7b07b9c8a0885725192f182364dc7541cf9a97 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Sun, 23 May 2021 01:49:37 +0200 Subject: [PATCH] [Client] Make potion effects work with SpellsActive packets --- apps/openmw/mwmp/DedicatedActor.cpp | 11 ++--------- apps/openmw/mwmp/LocalPlayer.cpp | 9 ++------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/apps/openmw/mwmp/DedicatedActor.cpp b/apps/openmw/mwmp/DedicatedActor.cpp index 34e07738d..c45a75fa7 100644 --- a/apps/openmw/mwmp/DedicatedActor.cpp +++ b/apps/openmw/mwmp/DedicatedActor.cpp @@ -365,15 +365,8 @@ void DedicatedActor::addSpellsActive() for (const auto& activeSpell : spellsActiveChanges.activeSpells) { - // Only add spells that are ensured to exist - if (MWBase::Environment::get().getWorld()->getStore().get().search(activeSpell.id)) - { - activeSpells.addSpell(activeSpell.id, false, activeSpell.params.mEffects, activeSpell.params.mDisplayName, 1); - } - else - { - LOG_APPEND(TimedLog::LOG_INFO, "- Ignored addition of invalid spell %s", activeSpell.id.c_str()); - } + // Don't do a check for a spell's existence, because active effects from potions need to be applied here too + activeSpells.addSpell(activeSpell.id, false, activeSpell.params.mEffects, activeSpell.params.mDisplayName, 1); } reloadPtr(); diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index 535a8595a..a76b3bb5f 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -718,13 +718,8 @@ void LocalPlayer::addSpellsActive() for (const auto& activeSpell : spellsActiveChanges.activeSpells) { - // Only add spells that are ensured to exist - if (MWBase::Environment::get().getWorld()->getStore().get().search(activeSpell.id)) - { - activeSpells.addSpell(activeSpell.id, false, activeSpell.params.mEffects, activeSpell.params.mDisplayName, 1); - } - else - LOG_APPEND(TimedLog::LOG_INFO, "- Ignored addition of invalid spell %s", activeSpell.id.c_str()); + // Don't do a check for a spell's existence, because active effects from potions need to be applied here too + activeSpells.addSpell(activeSpell.id, false, activeSpell.params.mEffects, activeSpell.params.mDisplayName, 1); } }