engine/actions/source/PickupAction.cpp
// Merge into the equipment, if possible (true is returned).
// If the item can't be merged into the equipment, return false.
Merge into the equipment, if possible (true is returned).
If the item can't be merged into the equipment, return false.
Merge into the equipment if possible ( true is returned ) . If the item can ' t be merged into the equipment return false .
bool PickupAction::merge_into_equipment(CreaturePtr creature, ItemPtr item)
{
  if (creature)
  {
    Equipment& equipment = creature->get_equipment();
    if (equipment.merge(item))
    {
      Game& game = Game::instance();
      CreaturePtr player = game.get_current_player();
       If the player is blind, only add a message if it is the player
       picking up an item.  Otherwise, always add a message.
      CurrentCreatureAbilities cca;
      bool player_blind = !cca.can_see(player);
      string item_merged_into_equipment;
       Only broadcast if it's the player, or the monster's in range.
      IMessageManager& manager = MM::instance(MessageTransmit::FOV, creature, creature && creature->get_is_player());
      if (!player_blind || (player_blind && creature->get_is_player()))
      {
        item_merged_into_equipment = TextMessages::get_item_pick_up_and_merge_message(player_blind, creature, item);
      }
      if (!item_merged_into_equipment.empty())
      {
        manager.add_new_message(item_merged_into_equipment);
        manager.send();
      }
      return true;
    }
  }
  return false;
}
bool PickupAction :: merge_into_equipment ( CreaturePtr creature , ItemPtr item ) { if ( creature ) { Equipment & equipment = creature -> get_equipment ( ) ; if ( equipment . merge ( item ) ) { Game & game = Game :: instance ( ) ; CreaturePtr player = game . get_current_player ( ) ; CurrentCreatureAbilities cca ; bool player_blind = ! cca . can_see ( player ) ; string item_merged_into_equipment ; IMessageManager & manager = MM :: instance ( MessageTransmit :: FOV , creature , creature && creature -> get_is_player ( ) ) ; if ( ! player_blind || ( player_blind && creature -> get_is_player ( ) ) ) { item_merged_into_equipment = TextMessages :: get_item_pick_up_and_merge_message ( player_blind , creature , item ) ; } if ( ! item_merged_into_equipment . empty ( ) ) { manager . add_new_message ( item_merged_into_equipment ) ; manager . send ( ) ; } return true ; } } return false ; }
Merge into the equipment, if possible (true is returned).
Merge into the equipment if possible ( true is returned ) .
// As all creatures can pick up items, check to see if: // - player is blind // - player or monster is picking up. // // If the player is blind, only add a message if it is the player // picking up an item.  Otherwise, always add a message. // Only broadcast if it's the player, or the monster's in range.