aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/economy/Good.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic/economy/Good.cpp')
-rw-r--r--src/openvic/economy/Good.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/openvic/economy/Good.cpp b/src/openvic/economy/Good.cpp
index 6d515d5..4524e5f 100644
--- a/src/openvic/economy/Good.cpp
+++ b/src/openvic/economy/Good.cpp
@@ -50,8 +50,12 @@ return_t GoodManager::add_good(std::string const& identifier, std::string const&
Logger::error("Invalid good identifier - empty!");
return FAILURE;
}
+ if (colour > MAX_COLOUR_RGB) {
+ Logger::error("Invalid good colour for ", identifier, ": ", Good::colour_to_hex_string(colour));
+ return FAILURE;
+ }
if (category.empty()) {
- Logger::error("Invalid good category - empty!");
+ Logger::error("Invalid good category for ", identifier, ": empty!");
return FAILURE;
}
if (base_price <= NULL_PRICE) {