[Client] Track actor IDs in ActiveSpells

pull/593/head
David Cernat 3 years ago
parent 3e81371e53
commit c027862609

@ -517,4 +517,22 @@ namespace MWMechanics
mSpellsChanged = true; mSpellsChanged = true;
} }
} }
/*
Start of tes3mp addition
Make it possible to set and get the actorId for these ActiveSpells
*/
int ActiveSpells::getActorId() const
{
return mActorId;
}
void ActiveSpells::setActorId(int actorId)
{
mActorId = actorId;
}
/*
End of tes3mp addition
*/
} }

@ -51,6 +51,16 @@ namespace MWMechanics
mutable MagicEffects mEffects; mutable MagicEffects mEffects;
mutable bool mSpellsChanged; mutable bool mSpellsChanged;
/*
Start of tes3mp addition
Track the actorId corresponding to these ActiveSpells
*/
int mActorId;
/*
End of tes3mp addition
*/
void rebuildEffects() const; void rebuildEffects() const;
/// Add any effects that are in "from" and not in "addTo" to "addTo" /// Add any effects that are in "from" and not in "addTo" to "addTo"
@ -146,6 +156,17 @@ namespace MWMechanics
void visitEffectSources (MWMechanics::EffectSourceVisitor& visitor) const; void visitEffectSources (MWMechanics::EffectSourceVisitor& visitor) const;
/*
Start of tes3mp addition
Make it possible to set and get the actorId for these ActiveSpells
*/
int getActorId() const;
void setActorId(int actorId);
/*
End of tes3mp addition
*/
}; };
} }

@ -128,6 +128,15 @@ namespace MWMechanics
ActiveSpells &CreatureStats::getActiveSpells() ActiveSpells &CreatureStats::getActiveSpells()
{ {
/*
Start of tes3mp addition
Set the actorId associated with these ActiveSpells so it can be used inside them
*/
mActiveSpells.setActorId(getActorId());
/*
End of tes3mp addition
*/
return mActiveSpells; return mActiveSpells;
} }

Loading…
Cancel
Save