Exemplo n.º 1
0
        public static void removeVob(Vob vob)
        {
            if (vob == null)
            {
                throw new ArgumentNullException("AddVob: Vob can't be null!");
            }
            if (vob.ID == 0)
            {
                throw new ArgumentException("AddVob: Vob.ID can't be null!");
            }
            if (!VobDict.ContainsKey(vob.ID))
            {
                throw new ArgumentException("AddVob: Vob.ID is not in the list: " + vob.ID + " " + vob.VobType + " " + vob);
            }

#if D_CLIENT
            if (vob.Address != 0)
            {
                sWorld.SpawnedVobDict.Remove(vob.Address);
                vob.Address = 0;
            }
#endif
            vob.IsSpawned = false;
            vob.Created   = false;
            if (vob.Map != null && vob.Map.Length != 0)
            {
                sWorld.getWorld(vob.Map).removeVob(vob);
            }

            VobDict.Remove(vob.ID);
            vob.Created = false;
        }
Exemplo n.º 2
0
        public static void removeVob(Vob vob)
        {
            if (vob == null)
            {
                throw new ArgumentNullException("Vob can't be null!");
            }
            if (vob.ID == 0)
            {
                throw new ArgumentException("Vob.ID can't be null!");
            }


            VobDict.Remove(vob.ID);

            if (vob is NPCProto)
            {
                removePlayer((NPCProto)vob);
            }
            else if (vob is Item)
            {
                removeItem((Item)vob);
            }
        }