diff options
author | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-07-25 07:04:21 +1000 |
---|---|---|
committer | Kae <80987908+Novaenia@users.noreply.github.com> | 2024-07-25 07:04:21 +1000 |
commit | 0634ae78fc20194ab594ca61a26b8bf8ac94c564 (patch) | |
tree | 06efdb76858b2016687f93d13954e3710bff6c3e /source/game/StarObject.cpp | |
parent | 6dd49fb69ac6c3d7db78f7edd7d9ccd445e674d5 (diff) |
Object::init - avoid throwing if 'scripts' parameter isn't an array for some reason
Diffstat (limited to 'source/game/StarObject.cpp')
-rw-r--r-- | source/game/StarObject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/game/StarObject.cpp b/source/game/StarObject.cpp index 3172c97..847f7c5 100644 --- a/source/game/StarObject.cpp +++ b/source/game/StarObject.cpp @@ -188,7 +188,7 @@ void Object::init(World* world, EntityId entityId, EntityMode mode) { setKeepAlive(configValue("keepAlive", false).toBool()); - auto scripts = jsonToStringList(configValue("scripts", JsonArray()).toArray()); + StringList scripts = configValue("scripts", JsonArray()).optArray().apply(jsonToStringList).value(m_config->scripts); m_scriptComponent.setScripts(scripts.transformed(bind(AssetPath::relativeTo, m_config->path, _1))); m_scriptComponent.setUpdateDelta(configValue("scriptDelta", 5).toInt()); |