Пример #1
0
        void WorldFilter_ReleaseObject(object sender, ReleaseObjectEventArgs e)
        {
            //Find the object in our list.
            for (int i = objects.Count - 1; i >= 0; --i)
            {
                if (e.Released.Id == objects[i].Guid)
                {
                    ObjectTrackerObject oldobj = objects[i];
                    objects.RemoveAt(i);

                    if (ObjectDeleted != null)
                    {
                        ObjectDeleted(oldobj, i);
                    }

                    break;
                }
            }
        }
Пример #2
0
        void WorldFilter_CreateObject(object sender, CreateObjectEventArgs e)
        {
            //In 2960 we need to do this to make sure the vendor object isn't initialized,
            //which can cause crashes at vendors.
            if (CoreManager.Current.WorldFilter[e.New.Id] == null)
            {
                return;
            }

            //Create the object and add it to our list
            ObjectTrackerObject myobject = new ObjectTrackerObject(e.New.Icon, e.New.Name, e.New.Id);

            objects.Add(myobject);

            //Notify anyone listening
            if (NewObjectDetected != null)
            {
                NewObjectDetected(myobject);
            }
        }