fix: loaded() event wasn't send to SubObject's
Dieser Commit ist enthalten in:
Ursprung
be918bb999
Commit
48882fcf73
@ -127,6 +127,14 @@ void Object::save(WorldSaver& saver, nlohmann::json& data, nlohmann::json& state
|
||||
}
|
||||
}
|
||||
|
||||
void Object::loaded()
|
||||
{
|
||||
for(auto& it : m_interfaceItems)
|
||||
if(AbstractProperty* property = dynamic_cast<AbstractProperty*>(&it.second))
|
||||
if(contains(property->flags(), PropertyFlags::SubObject))
|
||||
property->toObject()->loaded();
|
||||
}
|
||||
|
||||
void Object::worldEvent(WorldState state, WorldEvent event)
|
||||
{
|
||||
for(auto& it : m_interfaceItems)
|
||||
|
||||
@ -57,7 +57,7 @@ class Object : public std::enable_shared_from_this<Object>
|
||||
virtual void destroying() {}
|
||||
virtual void load(WorldLoader& loader, const nlohmann::json& data);
|
||||
virtual void save(WorldSaver& saver, nlohmann::json& data, nlohmann::json& state) const;
|
||||
virtual void loaded() {}
|
||||
virtual void loaded();
|
||||
virtual void worldEvent(WorldState state, WorldEvent event);
|
||||
|
||||
void logDebug(const std::string& message);
|
||||
|
||||
Laden…
x
In neuem Issue referenzieren
Einen Benutzer sperren