1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-07-21 03:44:05 +00:00

[Client] Make potion effects work with SpellsActive packets

This commit is contained in:
David Cernat 2021-05-23 01:49:37 +02:00
parent 7a6dfc61ec
commit 8c7b07b9c8
2 changed files with 4 additions and 16 deletions

View file

@ -365,16 +365,9 @@ void DedicatedActor::addSpellsActive()
for (const auto& activeSpell : spellsActiveChanges.activeSpells) for (const auto& activeSpell : spellsActiveChanges.activeSpells)
{ {
// Only add spells that are ensured to exist // Don't do a check for a spell's existence, because active effects from potions need to be applied here too
if (MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(activeSpell.id))
{
activeSpells.addSpell(activeSpell.id, false, activeSpell.params.mEffects, activeSpell.params.mDisplayName, 1); 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());
}
}
reloadPtr(); reloadPtr();
} }

View file

@ -718,14 +718,9 @@ void LocalPlayer::addSpellsActive()
for (const auto& activeSpell : spellsActiveChanges.activeSpells) for (const auto& activeSpell : spellsActiveChanges.activeSpells)
{ {
// Only add spells that are ensured to exist // Don't do a check for a spell's existence, because active effects from potions need to be applied here too
if (MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().search(activeSpell.id))
{
activeSpells.addSpell(activeSpell.id, false, activeSpell.params.mEffects, activeSpell.params.mDisplayName, 1); 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());
}
} }
void LocalPlayer::addJournalItems() void LocalPlayer::addJournalItems()