Object::init - avoid throwing if 'scripts' parameter isn't an array for some reason

This commit is contained in:
Kae 2024-07-25 07:04:21 +10:00
parent 6dd49fb69a
commit 0634ae78fc
2 changed files with 2 additions and 2 deletions

View File

@ -209,7 +209,7 @@ String CommandProcessor::timewarp(ConnectionId connectionId, String const& argum
return "Great Scott! We can't go back in time!";
m_universe->universeClock()->adjustTime(time);
return strf("It's just a jump to the {}...", time > 0.0 ? "left" : "right");
return time > 0.0 ? "It's just a jump to the left..." : "And then a step to the right...";
} catch (BadLexicalCast const&) {
return strf("Could not parse the argument {} as a time adjustment", arguments[0]);
}

View File

@ -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());