Веб-сайт самохостера Lotigara

summaryrefslogtreecommitdiff
path: root/source/game/StarTechController.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2023-06-25 18:12:54 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2023-06-25 18:12:54 +1000
commit7d205330dbf1c2fd44d9d58393ab46434ac8bb5e (patch)
treee73db06236120e2399f0b4863257477eec528295 /source/game/StarTechController.cpp
parente2424b7dcf60d18b277b092eb7f2a947fff27415 (diff)
More directives optimization
Diffstat (limited to 'source/game/StarTechController.cpp')
-rw-r--r--source/game/StarTechController.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/game/StarTechController.cpp b/source/game/StarTechController.cpp
index 1734c61..7ceb54e 100644
--- a/source/game/StarTechController.cpp
+++ b/source/game/StarTechController.cpp
@@ -251,7 +251,7 @@ Maybe<TechController::ParentState> TechController::parentState() const {
return m_parentState.get();
}
-String TechController::parentDirectives() const {
+DirectivesGroup const& TechController::parentDirectives() const {
return m_parentDirectives.get();
}
@@ -501,10 +501,11 @@ LuaCallbacks TechController::makeTechCallbacks(TechModule& techModule) {
callbacks.registerCallback("setParentDirectives", [this, &techModule](Maybe<String> const& directives) {
techModule.parentDirectives = directives.value();
- String newParentDirectives;
+
+ DirectivesGroup newParentDirectives;
for (auto& module : m_techModules)
- newParentDirectives += module.parentDirectives;
- m_parentDirectives.set(newParentDirectives);
+ newParentDirectives.append(module.parentDirectives);
+ m_parentDirectives.set(move(newParentDirectives));
});
callbacks.registerCallback("setParentHidden", [this](bool hidden) {