mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-29 17:15:32 +00:00
[Client] Set actor killer correctly for spells that do damage over time
Additionally, clean up comments related to other code that sets actor killers.
This commit is contained in:
parent
6e1504f0a1
commit
5d9893ee92
4 changed files with 23 additions and 5 deletions
|
@ -553,9 +553,10 @@ namespace MWClass
|
|||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
If the attacker was the LocalPlayer or LocalActor, record their target and send a packet with it
|
||||
If the attacker was the LocalPlayer or LocalActor, record their target and send a
|
||||
packet with it
|
||||
|
||||
If the victim was a LocalActor who died, record their attacker as the deathReason
|
||||
If the victim was a LocalActor who died, record their attacker as the killer
|
||||
*/
|
||||
mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(attacker);
|
||||
|
||||
|
|
|
@ -966,12 +966,13 @@ namespace MWClass
|
|||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
If the attacker was the LocalPlayer or LocalActor, record their target and send a packet with it
|
||||
If the attacker was the LocalPlayer or LocalActor, record their target and send a
|
||||
packet with it
|
||||
|
||||
If the victim was the LocalPlayer, check whether packets should be sent about
|
||||
their new dynamic stats and position
|
||||
|
||||
If the victim was a LocalActor who died, record their attacker as the deathReason
|
||||
If the victim was a LocalActor who died, record their attacker as the killer
|
||||
*/
|
||||
mwmp::Attack *localAttack = MechanicsHelper::getLocalAttack(attacker);
|
||||
|
||||
|
|
|
@ -842,6 +842,22 @@ namespace MWMechanics
|
|||
|
||||
if (isDamageEffect)
|
||||
{
|
||||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
If the victim was a LocalActor who died, record the caster as the killer
|
||||
*/
|
||||
if (mwmp::Main::get().getCellController()->isLocalActor(ptr))
|
||||
{
|
||||
bool isSuicide = ptr == caster || caster.isEmpty();
|
||||
|
||||
mwmp::Main::get().getCellController()->getLocalActor(ptr)->killer = isSuicide ?
|
||||
MechanicsHelper::getTarget(ptr) : MechanicsHelper::getTarget(caster);
|
||||
}
|
||||
/*
|
||||
End of tes3mp addition
|
||||
*/
|
||||
|
||||
if (caster == player || playerFollowers.find(caster) != playerFollowers.end())
|
||||
{
|
||||
if (caster.getClass().getNpcStats(caster).isWerewolf())
|
||||
|
|
|
@ -537,7 +537,7 @@ namespace MWMechanics
|
|||
/*
|
||||
Start of tes3mp addition
|
||||
|
||||
If the victim was a LocalPlayer or LocalActor who died, record their attacker as the deathReason
|
||||
If the victim was a LocalPlayer or LocalActor who died, record the caster as the killer
|
||||
*/
|
||||
if (!wasDead && isDead)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue