Review comments.

This commit is contained in:
henddher 2022-10-14 22:51:11 -05:00
parent 06c6d68634
commit 34c8cf9793

View file

@ -24,7 +24,7 @@ from django.core import exceptions as django_exceptions
from evennia.prototypes import spawner from evennia.prototypes import spawner
from evennia.utils.utils import class_from_module from evennia.utils.utils import class_from_module
from .utils import MAPSCAN, REVERSE_DIRECTIONS, MapParserError, BIGVAL from .utils import MAPSCAN, REVERSE_DIRECTIONS, MapParserError, BIGVAL, MapError
NodeTypeclass = None NodeTypeclass = None
ExitTypeclass = None ExitTypeclass = None
@ -402,11 +402,12 @@ class MapNode:
exitnode = self.links[direction] exitnode = self.links[direction]
prot = maplinks[key.lower()][3].prototype prot = maplinks[key.lower()][3].prototype
typeclass = prot.get("typeclass", "") typeclass = prot.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/updating exit xyz={xyz}, direction={key} ({typeclass})") self.log(f" spawning/updating exit xyz={xyz}, direction={key} ({typeclass})")
Typeclass = class_from_module(typeclass, Typeclass = class_from_module(typeclass)
fallback="evennia.contrib.grid.xyzgrid.xyzroom.XYZExit")
exi, err = Typeclass.create( exi, err = Typeclass.create(
key, key,
xyz=xyz, xyz=xyz,