Ejemplo n.º 1
0
        /// <summary>
        /// Removes an item from the world and raises the LeaveRegion event.
        /// </summary>
        /// <param name="item"></param>
        public void RemoveItem(MabiItem item)
        {
            lock (_items)
                _items.Remove(item);

            var disappears = new MabiPacket(Op.ItemDisappears, Id.Broadcast);
            disappears.PutLong(item.Id);
            this.Broadcast(disappears, SendTargets.Range, item);

            EventManager.EntityEvents.OnEntityLeavesRegion(item);

            item.Dispose();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Removes an item from the world and raises the LeaveRegion event.
        /// </summary>
        /// <param name="item"></param>
        public void RemoveItem(MabiItem item)
        {
            lock (_items)
                _items.Remove(item);

            var disappears = new MabiPacket(Op.ItemDisappears, Id.Broadcast);
            disappears.PutLong(item.Id);
            // Temp fix, because item's position might've changed by now...
            this.BroadcastRegion(disappears, item.Region);

            EventManager.EntityEvents.OnEntityLeavesRegion(item);

            item.Dispose();
        }