fix issue where upgrade modules are not working properly

This commit is contained in:
2026-06-09 22:58:48 +02:00
parent 121cd5407f
commit 510e37c37b
6 changed files with 419 additions and 13 deletions

View File

@@ -530,17 +530,19 @@ struct StatEntry
};
static const StatEntry kKnownStats[] = {
{"health", "hp", ""},
{"movement", "speed", "_mps"},
{"sensor", "sensor_range", "_m"},
{"weapon", "damage", ""},
{"weapon", "attack_range", "_m"},
{"weapon", "attack_rate", "_hz"},
{"salvage", "collection_range", "_m"},
{"salvage", "cargo_capacity", ""},
{"salvage", "collection_rate", "_hz"},
{"repair", "repair_rate", "_hz"},
{"repair", "repair_range", "_m"},
{"health", "hp", ""},
{"movement", "speed", "_mps"},
{"movement", "main_acceleration", "_mpss"},
{"movement", "maneuvering_acceleration", "_mpss"},
{"sensor", "sensor_range", "_m"},
{"weapon", "damage", ""},
{"weapon", "attack_range", "_m"},
{"weapon", "attack_rate", "_hz"},
{"salvage", "collection_range", "_m"},
{"salvage", "cargo_capacity", ""},
{"salvage", "collection_rate", "_hz"},
{"repair", "repair_rate", "_hz"},
{"repair", "repair_range", "_m"},
};
ModulesConfig ConfigLoader::loadModules(const std::string& path)
@@ -596,7 +598,7 @@ ModulesConfig ConfigLoader::loadModules(const std::string& path)
toml::table& catMt = const_cast<toml::table&>(catTable);
const std::string addedKey = std::string("added_") + se.stat + se.addedKeySuffix + "_formula";
const std::string multipliedKey = std::string("multiplied_") + se.stat + "_formula";
const std::string multipliedKey = std::string("multiplied_") + se.stat + se.addedKeySuffix + "_formula";
if (catMt.contains(addedKey))
{