From 7f8619d2c79a806f7dfe4375bf8dc93bff5d32e7 Mon Sep 17 00:00:00 2001 From: InspectorCaracal <51038201+InspectorCaracal@users.noreply.github.com> Date: Sat, 19 Oct 2024 16:30:13 -0600 Subject: [PATCH] properly load and reinitialize contents cache --- evennia/objects/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/evennia/objects/models.py b/evennia/objects/models.py index 544f33fd2d..dfc2e173ed 100644 --- a/evennia/objects/models.py +++ b/evennia/objects/models.py @@ -60,7 +60,7 @@ class ContentsHandler: Returns: Objects (list of ObjectDB) """ - return list(self.obj.locations_set.all()) + return list(obj for obj in self.obj.locations_set.all() if obj.pk) def init(self): """ @@ -68,6 +68,7 @@ class ContentsHandler: """ objects = self.load() + self._typecache = defaultdict(dict) self._pkcache = {obj.pk: True for obj in objects} for obj in objects: try: