this code make monster
Disappear..
can anyone help
Code:
public double interval = 100;
public System.Timers.Timer MyTimer;
public List<Interfaces.IMapObject> Objects;
public Client.GameState Owner;
private Queue<IMapObject> OnAdd;
private Queue<IMapObject> OnRemove;
public Screen(Client.GameState client)
{
Owner = client;
Objects = new List<IMapObject>(1000);
OnAdd = new Queue<IMapObject>(300);
OnRemove = new Queue<IMapObject>(300);
MyTimer = new System.Timers.Timer(interval);
MyTimer.AutoReset = true;
MyTimer.Elapsed += new System.Timers.ElapsedEventHandler(Sceen_thread);
MyTimer.Start();
}
public void Sceen_thread(object jjjhh, System.Timers.ElapsedEventArgs arg)
{
try
{
if (Owner.Alive)
{
try
{
while (OnAdd.Count != 0)
Objects.Add(OnAdd.Dequeue());
while (OnRemove.Count != 0)
Objects.Remove(OnRemove.Dequeue());
}
catch (Exception e)
{
Console.WriteLine(e.ToString());
}
if (Owner.Map.FreezeMonsters)
return;
for (int c = 0; c < Objects.Count; c++)
{
if (c >= Objects.Count)
break;
IMapObject obj = Objects[c];
if (obj != null)
{






