engine/items/source/InitialItemEquipper.cpp
// Process an initial inventory, adding the items to the creature's inventory.
Process an initial inventory, adding the items to the creature's inventory.
Process an initial inventory adding the items to the creature ' s inventory .
void InitialItemEquipper::process_initial_inventory(CreaturePtr creature, const vector<InitialItem>& initial_inventory, ActionManager& am)
{
  if (creature != nullptr)
  {
    for (const InitialItem& ii : initial_inventory)
    {
      InitialItemSelector iis;
      string creature_race = creature->get_race_id();
      pair<string, uint> item_details = iis.get_item_details(creature_race, ii);
      string item_id = item_details.first;
      uint item_quantity = item_details.second;
      if (!item_id.empty())
      {
        am.handle_item(creature, ItemAction::ITEM_ACTION_PICK_UP, ItemManager::create_item(item_id, item_quantity));
      }
    }
  }
}
void InitialItemEquipper :: process_initial_inventory ( CreaturePtr creature , const vector < InitialItem > & initial_inventory , ActionManager & am ) { if ( creature != nullptr ) { for ( const InitialItem & ii : initial_inventory ) { InitialItemSelector iis ; string creature_race = creature -> get_race_id ( ) ; pair < string , uint > item_details = iis . get_item_details ( creature_race , ii ) ; string item_id = item_details . first ; uint item_quantity = item_details . second ; if ( ! item_id . empty ( ) ) { am . handle_item ( creature , ItemAction :: ITEM_ACTION_PICK_UP , ItemManager :: create_item ( item_id , item_quantity ) ) ; } } } }
Process an initial inventory, adding the items to the creature's inventory.
Process an initial inventory adding the items to the creature ' s inventory .