diff options
Diffstat (limited to 'source/game/StarObject.cpp')
-rw-r--r-- | source/game/StarObject.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/game/StarObject.cpp b/source/game/StarObject.cpp index fe1f3f3..269181e 100644 --- a/source/game/StarObject.cpp +++ b/source/game/StarObject.cpp @@ -110,6 +110,8 @@ Object::Object(ObjectConfigConstPtr config, Json const& parameters) { m_netGroup.setNeedsLoadCallback(bind(&Object::getNetStates, this, _1)); m_netGroup.setNeedsStoreCallback(bind(&Object::setNetStates, this)); + + m_clientEntityMode = ClientEntityModeNames.getLeft(configValue("clientEntityMode", "ClientSlaveOnly").toString()); } Json Object::diskStore() const { @@ -127,6 +129,10 @@ EntityType Object::entityType() const { return EntityType::Object; } +ClientEntityMode Object::clientEntityMode() const { + return m_clientEntityMode; +} + void Object::init(World* world, EntityId entityId, EntityMode mode) { Entity::init(world, entityId, mode); // Only try and find a new orientation if we do not already have one, @@ -182,7 +188,7 @@ void Object::init(World* world, EntityId entityId, EntityMode mode) { setKeepAlive(configValue("keepAlive", false).toBool()); - m_scriptComponent.setScripts(m_config->scripts); + m_scriptComponent.setScripts(jsonToStringList(configValue("scripts", JsonArray()).toArray())); m_scriptComponent.setUpdateDelta(configValue("scriptDelta", 5).toInt()); m_scriptComponent.addCallbacks("object", makeObjectCallbacks()); |