Remove fallback from node's typeclass load.
This commit is contained in:
parent
10dea3ebd6
commit
1efa25a55d
1 changed files with 4 additions and 3 deletions
|
|
@ -319,10 +319,11 @@ class MapNode:
|
||||||
except django_exceptions.ObjectDoesNotExist:
|
except django_exceptions.ObjectDoesNotExist:
|
||||||
# create a new entity, using the specified typeclass (if there's one) and
|
# create a new entity, using the specified typeclass (if there's one) and
|
||||||
# with proper coordinates etc
|
# with proper coordinates etc
|
||||||
typeclass = self.prototype.get("typeclass", "")
|
typeclass = self.prototype.get("typeclass")
|
||||||
|
if typeclass is None:
|
||||||
|
raise MapError(f"The prototype {self.prototype} for this node has no 'typeclass' key.", self)
|
||||||
self.log(f" spawning room at xyz={xyz} ({typeclass})")
|
self.log(f" spawning room at xyz={xyz} ({typeclass})")
|
||||||
Typeclass = class_from_module(typeclass,
|
Typeclass = class_from_module(typeclass)
|
||||||
fallback="evennia.contrib.grid.xyzgrid.xyzroom.XYZRoom")
|
|
||||||
nodeobj, err = Typeclass.create(self.prototype.get("key", "An empty room"), xyz=xyz)
|
nodeobj, err = Typeclass.create(self.prototype.get("key", "An empty room"), xyz=xyz)
|
||||||
if err:
|
if err:
|
||||||
raise RuntimeError(err)
|
raise RuntimeError(err)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue