Skip to content
Snippets Groups Projects
Commit 358def61 authored by Jeffrey Phillips Freeman's avatar Jeffrey Phillips Freeman :boom:
Browse files

fixed rehydration for observers.

parent 3cecd2ac
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment