mirror of
https://github.com/evennia/evennia.git
synced 2026-03-16 21:06:30 +01:00
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:
|
||||
# create a new entity, using the specified typeclass (if there's one) and
|
||||
# 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})")
|
||||
Typeclass = class_from_module(typeclass,
|
||||
fallback="evennia.contrib.grid.xyzgrid.xyzroom.XYZRoom")
|
||||
Typeclass = class_from_module(typeclass)
|
||||
nodeobj, err = Typeclass.create(self.prototype.get("key", "An empty room"), xyz=xyz)
|
||||
if err:
|
||||
raise RuntimeError(err)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue