aboutsummaryrefslogtreecommitdiff
path: root/src/openvic-simulation/units/Unit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/openvic-simulation/units/Unit.cpp')
-rw-r--r--src/openvic-simulation/units/Unit.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/openvic-simulation/units/Unit.cpp b/src/openvic-simulation/units/Unit.cpp
index 55ff08d..63053c1 100644
--- a/src/openvic-simulation/units/Unit.cpp
+++ b/src/openvic-simulation/units/Unit.cpp
@@ -1,5 +1,4 @@
#include "Unit.hpp"
-#include <string_view>
#define UNIT_ARGS icon, sprite, active, type, floating_flag, priority, max_strength, \
default_organisation, maximum_speed, weighted_value, build_time, build_cost, supply_consumption, \
@@ -177,13 +176,18 @@ bool UnitManager::_check_shared_parameters(const std::string_view identifier, UN
return false;
}
- //TODO check that icon and sprite exist
+ if (sprite.empty()) {
+ Logger::error("Invalid sprite identifier - empty!");
+ return false;
+ }
- if (!allowed_unit_types.contains(type)) {
- Logger::error("Invalid unit type \"", type, "\" specified!");
+ if (type.empty()) {
+ Logger::error("Invalid unit type - empty!");
return false;
}
+ //TODO check that icon and sprite exist
+
return true;
}