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

summaryrefslogtreecommitdiff
path: root/source/game/StarObject.cpp
diff options
context:
space:
mode:
authorKae <80987908+Novaenia@users.noreply.github.com>2024-06-22 14:02:02 +1000
committerKae <80987908+Novaenia@users.noreply.github.com>2024-06-22 14:02:02 +1000
commit4c90472977f011352681ac774ca0b036f8cf0052 (patch)
treea09934a3823f3eb8b4b964e1211b4181e7bb4393 /source/game/StarObject.cpp
parent83686a816c8b1cb039e60ddb960ae9ab58a29ef9 (diff)
Read object script paths from params again taking relative paths into account
also made build artifact names a bit more consistent
Diffstat (limited to 'source/game/StarObject.cpp')
-rw-r--r--source/game/StarObject.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/game/StarObject.cpp b/source/game/StarObject.cpp
index e613efe..3172c97 100644
--- a/source/game/StarObject.cpp
+++ b/source/game/StarObject.cpp
@@ -188,7 +188,8 @@ void Object::init(World* world, EntityId entityId, EntityMode mode) {
setKeepAlive(configValue("keepAlive", false).toBool());
- m_scriptComponent.setScripts(m_config->scripts);
+ auto scripts = jsonToStringList(configValue("scripts", JsonArray()).toArray());
+ m_scriptComponent.setScripts(scripts.transformed(bind(AssetPath::relativeTo, m_config->path, _1)));
m_scriptComponent.setUpdateDelta(configValue("scriptDelta", 5).toInt());
m_scriptComponent.addCallbacks("object", makeObjectCallbacks());