mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-27 04:39:41 +00:00
[Client] Set LocalPlayer's killer for damage over time spell effects
Simplify related code that sets LocalActors' killers for damage over time spell effects.
This commit is contained in:
parent
94a9292cc6
commit
48ebdb38c7
1 changed files with 9 additions and 6 deletions
|
@ -845,14 +845,17 @@ namespace MWMechanics
|
|||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
If the victim was a LocalActor who died, record the caster as the killer
|
||||
If the victim was the LocalPlayer or a LocalActor, record the caster as their killer
|
||||
*/
|
||||
if (mwmp::Main::get().getCellController()->isLocalActor(ptr))
|
||||
{
|
||||
bool isSuicide = ptr == caster || caster.isEmpty();
|
||||
mwmp::Target killer = MechanicsHelper::getTarget(caster);
|
||||
|
||||
mwmp::Main::get().getCellController()->getLocalActor(ptr)->killer = isSuicide ?
|
||||
MechanicsHelper::getTarget(ptr) : MechanicsHelper::getTarget(caster);
|
||||
if (ptr == MWMechanics::getPlayer())
|
||||
{
|
||||
mwmp::Main::get().getLocalPlayer()->killer = killer;
|
||||
}
|
||||
else if (mwmp::Main::get().getCellController()->isLocalActor(ptr))
|
||||
{
|
||||
mwmp::Main::get().getCellController()->getLocalActor(ptr)->killer = killer;
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
|
|
Loading…
Reference in a new issue