From f3c7bd1d5e5b4d890ea11f4ee1bff3a978a40103 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 25 Nov 2023 23:03:46 +1100 Subject: Directives fixes --- source/game/StarParallax.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'source/game/StarParallax.cpp') diff --git a/source/game/StarParallax.cpp b/source/game/StarParallax.cpp index fe20f95..8ebb391 100644 --- a/source/game/StarParallax.cpp +++ b/source/game/StarParallax.cpp @@ -60,14 +60,16 @@ Json ParallaxLayer::store() const { void ParallaxLayer::addImageDirectives(Directives const& newDirectives) { if (newDirectives) { // TODO: Move to Directives += if (directives) { - String newString; + String dirString = directives.string(); - for (auto const& entry : newDirectives.shared->entries) { - newString += "+"; - newString += entry.string(*newDirectives.shared); + auto& newString = newDirectives.shared->string; + if (!newString.empty()) { + if (newString.utf8().front() != '?') + dirString += "?"; + dirString += newString; } - directives = move(newString); + directives = move(dirString); } else directives = newDirectives; -- cgit v1.2.3