engine/creatures/source/CreatureUtils.cpp
// Add a message about a change in hunger status, if appropriate.
Add a message about a change in hunger status, if appropriate.
Add a message about a change in hunger status if appropriate .
void CreatureUtils::add_hunger_level_message_if_necessary(CreaturePtr creature, const int old_hunger, const int new_hunger)
{
  HungerLevel old_level = HungerLevelConverter::to_hunger_level(old_hunger);
  HungerLevel new_level = HungerLevelConverter::to_hunger_level(new_hunger);
  if (old_level != new_level)
  {
    if (creature && creature->get_is_player())
    {
      IMessageManager& manager = MM::instance();
      if (hunger_message_sid_map.empty())
      {
        initialize_hunger_message_sid_map();
      }
      string message_sid = hunger_message_sid_map[new_level];
      manager.add_new_message(StringTable::get(message_sid));
      manager.send();
    }
  }
}
void CreatureUtils :: add_hunger_level_message_if_necessary ( CreaturePtr creature , const int old_hunger , const int new_hunger ) { HungerLevel old_level = HungerLevelConverter :: to_hunger_level ( old_hunger ) ; HungerLevel new_level = HungerLevelConverter :: to_hunger_level ( new_hunger ) ; if ( old_level != new_level ) { if ( creature && creature -> get_is_player ( ) ) { IMessageManager & manager = MM :: instance ( ) ; if ( hunger_message_sid_map . empty ( ) ) { initialize_hunger_message_sid_map ( ) ; } string message_sid = hunger_message_sid_map [ new_level ] ; manager . add_new_message ( StringTable :: get ( message_sid ) ) ; manager . send ( ) ; } } }
Add a message about a change in hunger status, if appropriate.
Add a message about a change in hunger status if appropriate .