Skip to content

Commit

Permalink
Clamp end_text_duration between 0 and 5 seconds
Browse files Browse the repository at this point in the history
  • Loading branch information
Vultraz committed Oct 4, 2020
1 parent b56ca64 commit 105a551
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/game_classification.cpp
Expand Up @@ -19,6 +19,7 @@
#include "serialization/string_utils.hpp"
#include "game_version.hpp"
#include "game_config_manager.hpp"
#include "utils/general.hpp"

#include <list>

Expand Down Expand Up @@ -48,7 +49,7 @@ game_classification::game_classification(const config& cfg)
, abbrev(cfg["abbrev"])
, end_credits(cfg["end_credits"].to_bool(true))
, end_text(cfg["end_text"])
, end_text_duration(cfg["end_text_duration"])
, end_text_duration(utils::clamp<unsigned>(cfg["end_text_duration"].to_unsigned(0), 0, 5000))
, difficulty(cfg["difficulty"].empty() ? DEFAULT_DIFFICULTY : cfg["difficulty"].str())
, random_mode(cfg["random_mode"])
, oos_debug(cfg["oos_debug"].to_bool(false))
Expand Down Expand Up @@ -159,4 +160,3 @@ std::set<std::string> game_classification::active_addons(const std::string& scen
}
return res;
}

0 comments on commit 105a551

Please sign in to comment.