fix(core): Removes some uses of Linq (#421)
- [X] Removes some uses of linq - [X] Creates struct based enumerator for Skills - [X] Creates a struct based enumerator for TypeCache - [X] Changes HarvestDefinition to an init array instead of List - [X] Changes HeritageTokenGump Response from List to Array
This commit is contained in:
parent
52356866ed
commit
b921c38879
50 changed files with 1006 additions and 507 deletions
|
|
@ -1,7 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Engines.PartySystem;
|
||||
using Server.Factions;
|
||||
using Server.Gumps;
|
||||
|
|
@ -1295,9 +1294,26 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
public static bool CheckCombat(Mobile m) =>
|
||||
m.Aggressed.Any(info => info.Defender.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay) ||
|
||||
m.Aggressors.Any(info => info.Attacker.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay);
|
||||
public static bool CheckCombat(Mobile m)
|
||||
{
|
||||
foreach (var info in m.Aggressed)
|
||||
{
|
||||
if (info.Defender.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var info in m.Aggressors)
|
||||
{
|
||||
if (info.Attacker.Player && DateTime.UtcNow - info.LastCombatTime < CombatDelay)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static void EventSink_Login(Mobile m)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue