Some cleanup of contains keys and try get values (#246)
This commit is contained in:
parent
9cbb0cfd23
commit
a236617ad9
69 changed files with 3508 additions and 350 deletions
|
|
@ -311,10 +311,9 @@ namespace Server.Regions
|
|||
if (IsGuardCandidate(m) &&
|
||||
(!AllowReds && m.Kills >= 5 && m.Region.IsPartOf(this) || m_GuardCandidates.ContainsKey(m)))
|
||||
{
|
||||
if (m_GuardCandidates.TryGetValue(m, out var timer))
|
||||
if (m_GuardCandidates.Remove(m, out var timer))
|
||||
{
|
||||
timer.Stop();
|
||||
m_GuardCandidates.Remove(m);
|
||||
}
|
||||
|
||||
MakeGuard(m);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue