/// <summary> /// Move a specified thing from the ground. /// </summary> private void MoveItemFromGround() { bool stackable = itemToMove.IsOfType(Constants.TYPE_STACKABLE) && itemToMove.Count != count; Item oldItem = null; if (!stackable) { map.RemoveThing(itemToMove, posFrom); } else { oldItem = itemToMove; oldItem.Count -= count; itemToMove = Item.CreateItem(itemToMove.ItemID); itemToMove.Count = count; } ThingSet tSet = map.GetThingsInVicinity(posFrom); foreach (Thing thing in tSet.GetThings()) { if (!stackable) { thing.RemoveThing(posFrom, stackpos); } else { thing.UpdateItem(posFrom, oldItem, stackpos); } } }
/// <summary> /// Removes the creature from the game world and only /// appends the data to the ThingSet without reseting or sending it. /// </summary> /// <param name="creature">The creature to remove.</param> /// <param name="tSet">A reference for which things to notify of the /// creature's removal.</param> private void AppendRemoveCreature(Creature creature) { creaturesOnline.Remove(creature.GetID()); creature.LogedIn = false; byte stackpos = gameMap.GetStackPosition(creature, creature.CurrentPosition); ThingSet tSet = gameMap.GetThingsInVicinity(creature.CurrentPosition); foreach (Monster summon in creature.GetSummons()) { summon.SetMaster(null); } foreach (Thing thing in tSet.GetThings()) { thing.RemoveThing(creature.CurrentPosition, stackpos); } gameMap.RemoveThing(creature, creature.CurrentPosition); }