[Client] Reload DedicatedActor ptrs when setting their active spells

This makes the spells' visual effects appear correctly.
pull/593/head
David Cernat 4 years ago
parent 1eeee29d51
commit e00ee1425a

@ -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);
}

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

Loading…
Cancel
Save