1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-07-13 06:21:42 +00:00

[Client] Reload DedicatedActor ptrs when setting their active spells

This makes the spells' visual effects appear correctly.
This commit is contained in:
David Cernat 2021-05-07 18:15:39 +02:00
parent 1eeee29d51
commit e00ee1425a
2 changed files with 12 additions and 0 deletions

View file

@ -371,8 +371,12 @@ void DedicatedActor::addSpellsActive()
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();
}
void DedicatedActor::removeSpellsActive()
@ -410,3 +414,10 @@ void DedicatedActor::setPtr(const MWWorld::Ptr& newPtr)
position = ptr.getRefData().getPosition();
drawState = ptr.getClass().getCreatureStats(ptr).getDrawState();
}
void DedicatedActor::reloadPtr()
{
MWBase::World* world = MWBase::Environment::get().getWorld();
world->disable(ptr);
world->enable(ptr);
}

View file

@ -35,6 +35,7 @@ namespace mwmp
MWWorld::Ptr getPtr();
void setPtr(const MWWorld::Ptr& newPtr);
void reloadPtr();
private:
MWWorld::Ptr ptr;