Skip to content

Commit

Permalink
OnLinkDeath: Prevent soft LDs from calling Notify and adding the …
Browse files Browse the repository at this point in the history
…player to `RvrLinkDeadPlayers`
  • Loading branch information
bm01 committed Aug 2, 2024
1 parent db8eab3 commit c9f7104
Showing 1 changed file with 8 additions and 15 deletions.
23 changes: 8 additions & 15 deletions GameServer/gameobjects/GamePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
using DOL.GS.PropertyCalc;
using DOL.GS.Quests;
using DOL.GS.RealmAbilities;
using DOL.GS.Scripts;
using DOL.GS.ServerProperties;
using DOL.GS.SkillHandler;
using DOL.GS.Spells;
Expand Down Expand Up @@ -912,30 +913,22 @@ public void OnLinkDeath()
if (log.IsInfoEnabled)
log.InfoFormat("Linkdead player {0}({1}) will quit in {2} seconds", Name, Client.Account.Name, SECONDS_TO_QUIT_ON_LINKDEATH);

// Keep link-dead characters in game.
_linkDeathTimer = new(this);
_linkDeathTimer = new(this); // Keep link-dead characters in game.
TradeWindow?.CloseTrade();
Group?.UpdateMember(this, false, false);

if (TradeWindow != null)
TradeWindow.CloseTrade();

// Notify players in close proximity (hard LD only).
// Hard LD only.
if (Client.ClientState is GameClient.eClientState.Linkdead)
{
foreach (GamePlayer playerInRadius in GetPlayersInRadius(WorldMgr.INFO_DISTANCE))
{
if (playerInRadius != this && GameServer.ServerRules.IsAllowedToUnderstand(this, playerInRadius))
playerInRadius.Out.SendMessage(LanguageMgr.GetTranslation(playerInRadius.Client.Account.Language, "GamePlayer.OnLinkdeath.Linkdead", Name), eChatType.CT_Important, eChatLoc.CL_SystemWindow);
}
}

// Notify other group members.
if (Group != null)
Group.UpdateMember(this, false, false);

CheckIfNearEnemyKeepAndAddToRvRLinkDeathListIfNecessary();

// Notify our event handlers (if any).
Notify(GamePlayerEvent.Linkdeath, this);
CheckIfNearEnemyKeepAndAddToRvRLinkDeathListIfNecessary();
Notify(GamePlayerEvent.Linkdeath, this);
}
}

private void CheckIfNearEnemyKeepAndAddToRvRLinkDeathListIfNecessary()
Expand Down

0 comments on commit c9f7104

Please sign in to comment.