X-Git-Url: https://mudpy.org/gitweb?p=mudpy.git;a=blobdiff_plain;f=mudpy%2Fmisc.py;h=4e32cccd5e99073b7f718bb3a7bbfc7eedb3086d;hp=af5427a86a059c091c6a41e899d0790a960f887f;hb=0d186d17647d956c9ffc7f36d4a250fa4d54a0f0;hpb=c9d0b133c1e83ba7396865cc690a0a84aba8ddc4 diff --git a/mudpy/misc.py b/mudpy/misc.py index af5427a..4e32ccc 100644 --- a/mudpy/misc.py +++ b/mudpy/misc.py @@ -347,6 +347,7 @@ class Universe: self.contents = {} self.default_origins = {} self.directions = set() + self.loading = False self.loglines = [] self.private_files = [] self.reload_flag = False @@ -375,6 +376,9 @@ class Universe: def load(self): """Load universe data from persistent storage.""" + # while loading, it's safe to update elements from read-only files + self.loading = True + # it's possible for this to enter before logging configuration is read pending_loglines = [] @@ -425,6 +429,10 @@ class Universe: for element in self.contents.values(): element.update_location() element.clean_contents() + + # done loading, so disallow updating elements from read-only files + self.loading = False + return pending_loglines def new(self):