diff --git a/lib/aethyr/core/components/storage.rb b/lib/aethyr/core/components/storage.rb index 5300485b2aedb0fd82c454ae7c0e1d557c3ef45a..f249225058ef537b182e3444ba0caa7d64147eab 100644 --- a/lib/aethyr/core/components/storage.rb +++ b/lib/aethyr/core/components/storage.rb @@ -306,6 +306,7 @@ class StorageMachine end end + object.rehydrate(nil) game_objects << object @@ -354,9 +355,8 @@ class StorageMachine object = Marshal.load(gd[id]) log "Loaded #{object}", Logger::Ultimate unless object.nil? or (not include_players and object.is_a? Player) - if object.is_a? Observable - fix_observers object - end + + object.rehydrate(nil) game_objects << object objects << object diff --git a/lib/aethyr/core/objects/game_object.rb b/lib/aethyr/core/objects/game_object.rb index 1fbd05ac56f9408a1b074aa9087909561828db78..e04a2631edb3129bc66e359af5ebef38246eab5c 100644 --- a/lib/aethyr/core/objects/game_object.rb +++ b/lib/aethyr/core/objects/game_object.rb @@ -12,6 +12,13 @@ class GameObject < Publisher include Observable include Pronoun + @@volatile = [] + + def self.volatile(*attrs) + @@volatile += attrs + @@volatile.uniq! + end + attr_reader :short_desc, :game_object_id, :alt_names, :generic, :article, :sex, :show_in_look, :actions, :balance, :admin, :manager attr_accessor :container, :show_in_look, :actions, :pose, :visible, :comment, :movable, :quantity, :info attr_writer :plural @@ -20,13 +27,6 @@ class GameObject < Publisher alias :goid :game_object_id volatile :@observer_peers - @@volatile = [] - - def self.volatile(*attrs) - @@volatile += attrs - @@volatile.uniq! - end - #Creates a new GameObject. Most of this long list of parameters is simply ignored at creation time, #because they can all be set later. def initialize(game_object_id = nil, container = nil, name = "", alt_names = Array.new, short_desc = "Nothing interesting here.", long_desc = "", generic = "", sex = "n", article = "a")