Apply looping particles when adding spell to existing actor (bug #4918)

pull/541/head
Andrei Kortunov 6 years ago
parent 8cb4898ae7
commit 5508e67aad

@ -51,6 +51,7 @@
Bug #4896: Title screen music doesn't loop Bug #4896: Title screen music doesn't loop
Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5 Bug #4911: Editor: QOpenGLContext::swapBuffers() warning with Qt5
Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used. Bug #4916: Specular power (shininess) material parameter is ignored when shaders are used.
Bug #4918: Abilities don't play looping VFX when they're initially applied
Bug #4922: Werewolves can not attack if the transformation happens during attack Bug #4922: Werewolves can not attack if the transformation happens during attack
Bug #4927: Spell effect having both a skill and an attribute assigned is a fatal error Bug #4927: Spell effect having both a skill and an attribute assigned is a fatal error
Bug #4932: Invalid records matching when loading save with edited plugin Bug #4932: Invalid records matching when loading save with edited plugin

@ -57,6 +57,7 @@ namespace MWMechanics
{ {
// Contracted disease! // Contracted disease!
actor.getClass().getCreatureStats(actor).getSpells().add(it->first); actor.getClass().getCreatureStats(actor).getSpells().add(it->first);
MWBase::Environment::get().getWorld()->applyLoopingParticles(actor);
std::string msg = "sMagicContractDisease"; std::string msg = "sMagicContractDisease";
msg = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(msg)->mValue.getString(); msg = MWBase::Environment::get().getWorld()->getStore().get<ESM::GameSetting>().find(msg)->mValue.getString();

@ -455,10 +455,16 @@ namespace MWScript
std::string id = runtime.getStringLiteral (runtime[0].mInteger); std::string id = runtime.getStringLiteral (runtime[0].mInteger);
runtime.pop(); runtime.pop();
// make sure a spell with this ID actually exists. const ESM::Spell* spell = MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
MWBase::Environment::get().getWorld()->getStore().get<ESM::Spell>().find (id);
ptr.getClass().getCreatureStats (ptr).getSpells().add (id); MWMechanics::CreatureStats& creatureStats = ptr.getClass().getCreatureStats(ptr);
creatureStats.getSpells().add(id);
ESM::Spell::SpellType type = static_cast<ESM::Spell::SpellType>(spell->mData.mType);
if (type != ESM::Spell::ST_Spell && type != ESM::Spell::ST_Power)
{
// Apply looping particles immediately for constant effects
MWBase::Environment::get().getWorld()->applyLoopingParticles(ptr);
}
} }
}; };

Loading…
Cancel
Save