/** * \brief Sets the maximum number of magic points. * * Exits with an error message if the value specified * if not valid. * * \param max_magic the maximum level of magic */ void Equipment::set_max_magic(int max_magic) { Debug::check_assertion(max_magic >= 0, "Invalid magic amount"); savegame.set_integer(Savegame::KEY_MAX_MAGIC, max_magic); restore_all_magic(); }
/** * \brief Sets the maximum number of magic points. * * Exits with an error message if the value specified * if not valid. * * \param max_magic the maximum level of magic */ void Equipment::set_max_magic(int max_magic) { Debug::check_assertion(max_magic >= 0, StringConcat() << "Illegal maximum number of magic points: " << max_magic); savegame.set_integer(Savegame::KEY_MAX_MAGIC, max_magic); restore_all_magic(); }
/** * \brief Sets the maximum number of magic points. * * Exits with an error message if the value specified * if not valid. * * \param max_magic the maximum level of magic */ void Equipment::set_max_magic(int max_magic) { if (max_magic < 0) { std::ostringstream oss; oss << "Illegal maximum number of magic points: " << max_magic; Debug::die(oss.str()); } savegame.set_integer(Savegame::KEY_MAX_MAGIC, max_magic); restore_all_magic(); }