1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 08:35:20 +02:00

Make string to v3f parsing consistent, replace core.setting_get_pos() by core.settings:get_pos() (#15438)

Co-authored-by: sfan5 <sfan5@live.de>
Co-authored-by: Lars Müller <34514239+appgurueu@users.noreply.github.com>
This commit is contained in:
AFCMS
2024-12-04 18:19:46 +01:00
committed by GitHub
parent 18caf3a18d
commit e545e96d2b
17 changed files with 162 additions and 45 deletions

View File

@@ -103,8 +103,17 @@ void MapgenFractalParams::readParams(const Settings *settings)
settings->getS16NoEx("mgfractal_dungeon_ymax", dungeon_ymax);
settings->getU16NoEx("mgfractal_fractal", fractal);
settings->getU16NoEx("mgfractal_iterations", iterations);
settings->getV3FNoEx("mgfractal_scale", scale);
settings->getV3FNoEx("mgfractal_offset", offset);
std::optional<v3f> mgfractal_scale;
if (settings->getV3FNoEx("mgfractal_scale", mgfractal_scale) && mgfractal_scale.has_value()) {
scale = *mgfractal_scale;
}
std::optional<v3f> mgfractal_offset;
if (settings->getV3FNoEx("mgfractal_offset", mgfractal_offset) && mgfractal_offset.has_value()) {
offset = *mgfractal_offset;
}
settings->getFloatNoEx("mgfractal_slice_w", slice_w);
settings->getFloatNoEx("mgfractal_julia_x", julia_x);
settings->getFloatNoEx("mgfractal_julia_y", julia_y);