fix issue where upgrade modules are not working properly
This commit is contained in:
@@ -157,6 +157,22 @@ ShipStats calculateShipStats(const GameConfig& config,
|
||||
}
|
||||
}
|
||||
|
||||
// Acceleration additive modifiers are in m/s² in config; convert to tiles/s².
|
||||
const char* const kAccelerationStats[] = {
|
||||
"main_acceleration", "maneuvering_acceleration"
|
||||
};
|
||||
for (const char* stat : kAccelerationStats)
|
||||
{
|
||||
for (std::map<std::string, std::pair<double, double>>* mods : allModMaps)
|
||||
{
|
||||
std::map<std::string, std::pair<double, double>>::iterator it = mods->find(stat);
|
||||
if (it != mods->end())
|
||||
{
|
||||
it->second.second /= tileSize;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto applyMod = [](float& stat, const std::string& name,
|
||||
const std::map<std::string, std::pair<double, double>>& mods)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user