From 4c90472977f011352681ac774ca0b036f8cf0052 Mon Sep 17 00:00:00 2001 From: Kae <80987908+Novaenia@users.noreply.github.com> Date: Sat, 22 Jun 2024 14:02:02 +1000 Subject: [PATCH] Read object script paths from params again taking relative paths into account also made build artifact names a bit more consistent --- .github/workflows/build_macos.yml | 4 ++-- .github/workflows/build_windows.yml | 2 +- source/game/StarObject.cpp | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build_macos.yml b/.github/workflows/build_macos.yml index 951cc40..1cfd12c 100644 --- a/.github/workflows/build_macos.yml +++ b/.github/workflows/build_macos.yml @@ -51,7 +51,7 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: OpenStarbound-Dev-macOS-Intel + name: OpenStarbound-macOS-Intel path: dist/* build-arm: @@ -93,5 +93,5 @@ jobs: - name: Upload Artifacts uses: actions/upload-artifact@v4 with: - name: OpenStarbound-Dev-macOS-Silicon + name: OpenStarbound-macOS-Silicon path: dist/* \ No newline at end of file diff --git a/.github/workflows/build_windows.yml b/.github/workflows/build_windows.yml index cf50594..d3ee36b 100644 --- a/.github/workflows/build_windows.yml +++ b/.github/workflows/build_windows.yml @@ -85,5 +85,5 @@ jobs: - name: Upload Installer uses: actions/upload-artifact@v4 with: - name: Installer + name: OpenStarbound-Windows-Installer path: installer/* 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());