Exemple #1
0
        /// <summary>
        /// Removes a creature from the world, and raises the LeaveRegion event.
        /// </summary>
        /// <param name="creature"></param>
        public void RemoveCreature(MabiCreature creature)
        {
            lock (_creatures)
            {
                _creatures.Remove(creature);
            }
            if (creature.Client is WorldClient)
            {
                lock (_clients)
                {
                    _clients.Remove(creature.Client as WorldClient);
                }
            }

            if (creature.Party != null)
                this.CreatureLeaveParty(creature);

            this.CreatureLeaveRegion(creature);
            creature.Dispose();
        }