mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
[Client] Avoid incrementing actor death count if we aren't its authority
This commit is contained in:
parent
66a3f3d475
commit
9a519b5cc2
@ -1482,7 +1482,20 @@ namespace MWMechanics
|
|||||||
{
|
{
|
||||||
iter->first.getClass().getCreatureStats(iter->first).notifyDied();
|
iter->first.getClass().getCreatureStats(iter->first).notifyDied();
|
||||||
|
|
||||||
|
/*
|
||||||
|
Start of tes3mp change (major)
|
||||||
|
|
||||||
|
Only increment death count for an actor if we are its authority, to avoid
|
||||||
|
situations where we increment it locally after having already received an
|
||||||
|
ID_PLAYER_KILL_COUNT packet about it
|
||||||
|
*/
|
||||||
|
bool isLocalActor = mwmp::Main::get().getCellController()->isLocalActor(iter->first);
|
||||||
|
|
||||||
|
if (isLocalActor)
|
||||||
++mDeathCount[Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId())];
|
++mDeathCount[Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId())];
|
||||||
|
/*
|
||||||
|
End of tes3mp change (major)
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Start of tes3mp addition
|
Start of tes3mp addition
|
||||||
@ -1490,7 +1503,7 @@ namespace MWMechanics
|
|||||||
Send an ID_PLAYER_KILL_COUNT packet every time the kill count changes,
|
Send an ID_PLAYER_KILL_COUNT packet every time the kill count changes,
|
||||||
as long as we are the authority over the actor's cell
|
as long as we are the authority over the actor's cell
|
||||||
*/
|
*/
|
||||||
if (mwmp::Main::get().getCellController()->isLocalActor(iter->first))
|
if (isLocalActor)
|
||||||
{
|
{
|
||||||
std::string refId = Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId());
|
std::string refId = Misc::StringUtils::lowerCase(iter->first.getCellRef().getRefId());
|
||||||
int number = mDeathCount[refId];
|
int number = mDeathCount[refId];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user