Modernization Fixes & Updates to Default Values (#3)
This commit is contained in:
parent
445eddff68
commit
dcf64091b1
768 changed files with 10507 additions and 14196 deletions
|
|
@ -42,7 +42,7 @@ namespace Server.Items
|
|||
{
|
||||
ItemID = 0xA57;
|
||||
|
||||
if (!from.HasGump(typeof(LogoutGump)))
|
||||
if (!from.HasGump<LogoutGump>())
|
||||
{
|
||||
CampfireEntry entry = Campfire.GetEntry(from);
|
||||
|
||||
|
|
@ -123,7 +123,7 @@ namespace Server.Items
|
|||
private void CloseGump()
|
||||
{
|
||||
Campfire.RemoveEntry(m_Entry);
|
||||
m_Entry.Player.CloseGump(typeof(LogoutGump));
|
||||
m_Entry.Player.CloseGump<LogoutGump>();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using Server.Mobiles;
|
||||
using Server.Network;
|
||||
|
||||
|
|
@ -16,9 +17,9 @@ namespace Server.Items
|
|||
{
|
||||
public static readonly int SecureRange = 7;
|
||||
|
||||
private static readonly Hashtable m_Table = new Hashtable();
|
||||
private static readonly Dictionary<Mobile, CampfireEntry> m_Table = new Dictionary<Mobile, CampfireEntry>();
|
||||
|
||||
private ArrayList m_Entries;
|
||||
private List<CampfireEntry> m_Entries;
|
||||
|
||||
private Timer m_Timer;
|
||||
|
||||
|
|
@ -27,7 +28,7 @@ namespace Server.Items
|
|||
Movable = false;
|
||||
Light = LightType.Circle300;
|
||||
|
||||
m_Entries = new ArrayList();
|
||||
m_Entries = new List<CampfireEntry>();
|
||||
|
||||
Created = DateTime.UtcNow;
|
||||
m_Timer = Timer.DelayCall(TimeSpan.FromSeconds(1.0), TimeSpan.FromSeconds(1.0), OnTick);
|
||||
|
|
@ -85,7 +86,7 @@ namespace Server.Items
|
|||
|
||||
public static CampfireEntry GetEntry(Mobile player)
|
||||
{
|
||||
return (CampfireEntry)m_Table[player];
|
||||
return m_Table[player];
|
||||
}
|
||||
|
||||
public static void RemoveEntry(CampfireEntry entry)
|
||||
|
|
@ -109,11 +110,9 @@ namespace Server.Items
|
|||
if (Status == CampfireStatus.Off || Deleted)
|
||||
return;
|
||||
|
||||
foreach (CampfireEntry entry in new ArrayList(m_Entries))
|
||||
foreach (CampfireEntry entry in m_Entries.ToList())
|
||||
if (!entry.Valid || entry.Player.NetState == null)
|
||||
{
|
||||
RemoveEntry(entry);
|
||||
}
|
||||
else if (!entry.Safe && now - entry.Start >= TimeSpan.FromSeconds(30.0))
|
||||
{
|
||||
entry.Safe = true;
|
||||
|
|
@ -141,7 +140,8 @@ namespace Server.Items
|
|||
if (m_Entries == null)
|
||||
return;
|
||||
|
||||
foreach (CampfireEntry entry in new ArrayList(m_Entries)) RemoveEntry(entry);
|
||||
foreach (CampfireEntry entry in m_Entries.ToList())
|
||||
RemoveEntry(entry);
|
||||
}
|
||||
|
||||
public override void OnAfterDelete()
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Server.Network;
|
||||
using Server.Regions;
|
||||
|
||||
|
|
@ -72,13 +72,13 @@ namespace Server.Items
|
|||
|
||||
private Point3D GetFireLocation(Mobile from)
|
||||
{
|
||||
if (from.Region.IsPartOf(typeof(DungeonRegion)))
|
||||
if (from.Region.IsPartOf<DungeonRegion>())
|
||||
return Point3D.Zero;
|
||||
|
||||
if (Parent == null)
|
||||
return Location;
|
||||
|
||||
ArrayList list = new ArrayList(4);
|
||||
List<Point3D> list = new List<Point3D>(4);
|
||||
|
||||
AddOffsetLocation(from, 0, -1, list);
|
||||
AddOffsetLocation(from, -1, 0, list);
|
||||
|
|
@ -89,10 +89,10 @@ namespace Server.Items
|
|||
return Point3D.Zero;
|
||||
|
||||
int idx = Utility.Random(list.Count);
|
||||
return (Point3D)list[idx];
|
||||
return list[idx];
|
||||
}
|
||||
|
||||
private void AddOffsetLocation(Mobile from, int offsetX, int offsetY, ArrayList list)
|
||||
private void AddOffsetLocation(Mobile from, int offsetX, int offsetY, List<Point3D> list)
|
||||
{
|
||||
Map map = from.Map;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue