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

[Client] Track actor IDs in ActiveSpells

This commit is contained in:
David Cernat 2021-10-12 00:34:15 +02:00
parent 3e81371e53
commit c027862609
3 changed files with 48 additions and 0 deletions

View file

@ -517,4 +517,22 @@ namespace MWMechanics
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
*/
}

View file

@ -51,6 +51,16 @@ namespace MWMechanics
mutable MagicEffects mEffects;
mutable bool mSpellsChanged;
/*
Start of tes3mp addition
Track the actorId corresponding to these ActiveSpells
*/
int mActorId;
/*
End of tes3mp addition
*/
void rebuildEffects() const;
/// 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;
/*
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
*/
};
}

View file

@ -128,6 +128,15 @@ namespace MWMechanics
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;
}