aboutsummaryrefslogtreecommitdiff
path: root/src/openvic/economy/Good.cpp
diff options
context:
space:
mode:
author Hop311 <Hop3114@gmail.com>2023-07-28 00:10:46 +0200
committer GitHub <noreply@github.com>2023-07-28 00:10:46 +0200
commit8a08be3e7e8477973e243716d431ad7117acfa43 (patch)
treea91587787bf6742168279ac41f77b9ebabe0dffe /src/openvic/economy/Good.cpp
parent420c2dce47e74c01ff46be991058d543e0c70a6b (diff)
parent532c9be36ca03ee13c92ca7d895aaf5b42eeb034 (diff)
Merge pull request #9 from OpenVicProject/pops
Pops and other bits
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) {