From c3d1eada8955300315afef8a12788d7f4a5d3270 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Thu, 31 Aug 2017 06:42:11 +0300 Subject: [PATCH] [Client] Only add spells to players that are ensured to exist --- apps/openmw/mwmp/LocalPlayer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwmp/LocalPlayer.cpp b/apps/openmw/mwmp/LocalPlayer.cpp index d4f9ffcd1..f71c43e50 100644 --- a/apps/openmw/mwmp/LocalPlayer.cpp +++ b/apps/openmw/mwmp/LocalPlayer.cpp @@ -648,8 +648,9 @@ void LocalPlayer::addSpells() MWMechanics::Spells &ptrSpells = ptrPlayer.getClass().getCreatureStats(ptrPlayer).getSpells(); for (const auto &spell : spellbookChanges.spells) - ptrSpells.add(spell.mId); - + // Only add spells that are ensured to exist + if (MWBase::Environment::get().getWorld()->getStore().get().search(spell.mId)) + ptrSpells.add(spell.mId); } void LocalPlayer::addJournalItems()