Merge pull request #2515 from ChrisLR/XYMap-Django-Exception
Fix exception leaking when spawning XYRoom Nodes
This commit is contained in:
commit
c482ee3bc1
1 changed files with 5 additions and 3 deletions
|
|
@ -18,8 +18,10 @@ except ImportError as err:
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
from collections import defaultdict
|
from collections import defaultdict
|
||||||
|
|
||||||
|
from django.core import exceptions as django_exceptions
|
||||||
from evennia.prototypes import spawner
|
from evennia.prototypes import spawner
|
||||||
from evennia.utils.utils import make_iter
|
|
||||||
from .utils import MAPSCAN, REVERSE_DIRECTIONS, MapParserError, BIGVAL
|
from .utils import MAPSCAN, REVERSE_DIRECTIONS, MapParserError, BIGVAL
|
||||||
|
|
||||||
NodeTypeclass = None
|
NodeTypeclass = None
|
||||||
|
|
@ -309,7 +311,7 @@ class MapNode:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
nodeobj = NodeTypeclass.objects.get_xyz(xyz=xyz)
|
nodeobj = NodeTypeclass.objects.get_xyz(xyz=xyz)
|
||||||
except NodeTypeclass.DoesNotExist:
|
except django_exceptions.ObjectDoesNotExist:
|
||||||
# create a new entity with proper coordinates etc
|
# create a new entity with proper coordinates etc
|
||||||
tclass = self.prototype['typeclass']
|
tclass = self.prototype['typeclass']
|
||||||
tclass = (f' ({tclass})'
|
tclass = (f' ({tclass})'
|
||||||
|
|
@ -433,7 +435,7 @@ class MapNode:
|
||||||
|
|
||||||
try:
|
try:
|
||||||
nodeobj = NodeTypeclass.objects.get_xyz(xyz=xyz)
|
nodeobj = NodeTypeclass.objects.get_xyz(xyz=xyz)
|
||||||
except NodeTypeclass.DoesNotExist:
|
except django_exceptions.ObjectDoesNotExist:
|
||||||
# no object exists
|
# no object exists
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue