remove old hashtables from animal taming, inscription, and invisibility code

This commit is contained in:
Mark Sturgill 2014-02-14 21:19:41 -07:00
parent af0ec21a07
commit ac17483ab4
3 changed files with 14 additions and 11 deletions

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Targeting;
using Server.Network;
@ -12,7 +12,7 @@ namespace Server.SkillHandlers
{
public class AnimalTaming
{
private static Hashtable m_BeingTamed = new Hashtable();
private static Dictionary<Mobile, Mobile> m_BeingTamed = new Dictionary<Mobile, Mobile>();
public static void Initialize()
{
@ -182,7 +182,7 @@ namespace Server.SkillHandlers
}
}
if ( m_BeingTamed.Contains( targeted ) )
if ( m_BeingTamed.ContainsKey( creature ) )
{
creature.PrivateOverheadMessage( MessageType.Regular, 0x3B2, 502802, from.NetState ); // Someone else is already taming this.
}
@ -211,7 +211,7 @@ namespace Server.SkillHandlers
}
else
{
m_BeingTamed[targeted] = from;
m_BeingTamed[creature] = from;
from.LocalOverheadMessage( MessageType.Emote, 0x59, 1010597 ); // You start to tame the creature.
from.NonlocalOverheadMessage( MessageType.Emote, 0x59, 1010598 ); // *begins taming a creature.*

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Targeting;
using Server.Items;
@ -23,7 +23,7 @@ namespace Server.SkillHandlers
return TimeSpan.FromSeconds( 1.0 );
}
private static Hashtable m_UseTable = new Hashtable();
private static Dictionary<BaseBook, Mobile> m_UseTable = new Dictionary<BaseBook, Mobile>();
private static void SetUser( BaseBook book, Mobile mob )
{
@ -37,7 +37,9 @@ namespace Server.SkillHandlers
public static Mobile GetUser( BaseBook book )
{
return (Mobile)m_UseTable[book];
Mobile m = null;
m_UseTable.TryGetValue(book, out m);
return m;
}
public static bool IsEmpty( BaseBook book )

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server;
using Server.Targeting;
using Server.Items;
@ -76,16 +76,17 @@ namespace Server.Spells.Sixth
FinishSequence();
}
private static Hashtable m_Table = new Hashtable();
private static Dictionary<Mobile, Timer> m_Table = new Dictionary<Mobile, Timer>();
public static bool HasTimer( Mobile m )
{
return m_Table[m] != null;
return m_Table.ContainsKey(m);
}
public static void RemoveTimer( Mobile m )
{
Timer t = (Timer)m_Table[m];
Timer t = null;
m_Table.TryGetValue(m, out t);
if ( t != null )
{