Make XYZGrid zcoords db query case insensitive. Resolve #3331
This commit is contained in:
parent
89d159cc96
commit
32cbbd063a
3 changed files with 13 additions and 6 deletions
|
|
@ -41,6 +41,7 @@
|
||||||
instantiated script. (Volund)
|
instantiated script. (Volund)
|
||||||
- [Fix][pull3338]: Resolve if/elif bug in XYZGrid contrib launch command
|
- [Fix][pull3338]: Resolve if/elif bug in XYZGrid contrib launch command
|
||||||
(jaborsh)
|
(jaborsh)
|
||||||
|
- [fix][issue3331]: Made XYZGrid query zcoords in a case-insensitive manner.
|
||||||
- [Fix][pull3322]: Fix `BaseOption.display` to always return a string.
|
- [Fix][pull3322]: Fix `BaseOption.display` to always return a string.
|
||||||
- Docs: Lots of Typo fixes (iLPdev, InspectorCaracal, jaborsh)
|
- Docs: Lots of Typo fixes (iLPdev, InspectorCaracal, jaborsh)
|
||||||
- Beginner tutorial: Cleanup and starting earlier with explaining how to add to
|
- Beginner tutorial: Cleanup and starting earlier with explaining how to add to
|
||||||
|
|
@ -65,6 +66,7 @@
|
||||||
[issue3272]: https://github.com/evennia/evennia/issues/3272
|
[issue3272]: https://github.com/evennia/evennia/issues/3272
|
||||||
[issue3273]: https://github.com/evennia/evennia/issues/3273
|
[issue3273]: https://github.com/evennia/evennia/issues/3273
|
||||||
[issue3308]: https://github.com/evennia/evennia/issues/3307
|
[issue3308]: https://github.com/evennia/evennia/issues/3307
|
||||||
|
[issue3331]: https://github.com/evennia/evennia/issues/3331
|
||||||
|
|
||||||
## Evennia 2.3.0
|
## Evennia 2.3.0
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -319,6 +319,8 @@ Most users will want to just treat each map as a location, and name the
|
||||||
"Z-coordinate" things like `Dungeon of Doom`, `The ice queen's palace` or `City
|
"Z-coordinate" things like `Dungeon of Doom`, `The ice queen's palace` or `City
|
||||||
of Blackhaven`. But you could also name it -1, 0, 1, 2, 3 if you wanted.
|
of Blackhaven`. But you could also name it -1, 0, 1, 2, 3 if you wanted.
|
||||||
|
|
||||||
|
> Note that the Zcoord is searched *non-case senstively* in the
|
||||||
|
|
||||||
Pathfinding happens only within each XYMap (up/down is normally 'faked' by moving
|
Pathfinding happens only within each XYMap (up/down is normally 'faked' by moving
|
||||||
sideways to a new area of the XY plane).
|
sideways to a new area of the XY plane).
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ used as stand-alone XYZ-coordinate-aware rooms.
|
||||||
|
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.db.models import Q
|
from django.db.models import Q
|
||||||
|
|
||||||
from evennia.objects.manager import ObjectManager
|
from evennia.objects.manager import ObjectManager
|
||||||
from evennia.objects.objects import DefaultExit, DefaultRoom
|
from evennia.objects.objects import DefaultExit, DefaultRoom
|
||||||
|
|
||||||
|
|
@ -71,7 +70,7 @@ class XYZManager(ObjectManager):
|
||||||
.filter(
|
.filter(
|
||||||
Q()
|
Q()
|
||||||
if z == wildcard
|
if z == wildcard
|
||||||
else Q(db_tags__db_key=str(z), db_tags__db_category=MAP_Z_TAG_CATEGORY)
|
else Q(db_tags__db_key__iexact=str(z), db_tags__db_category=MAP_Z_TAG_CATEGORY)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -165,7 +164,7 @@ class XYZExitManager(XYZManager):
|
||||||
.filter(
|
.filter(
|
||||||
Q()
|
Q()
|
||||||
if z == wildcard
|
if z == wildcard
|
||||||
else Q(db_tags__db_key=str(z), db_tags__db_category=MAP_Z_TAG_CATEGORY)
|
else Q(db_tags__db_key__iexact=str(z), db_tags__db_category=MAP_Z_TAG_CATEGORY)
|
||||||
)
|
)
|
||||||
.filter(
|
.filter(
|
||||||
Q()
|
Q()
|
||||||
|
|
@ -180,7 +179,9 @@ class XYZExitManager(XYZManager):
|
||||||
.filter(
|
.filter(
|
||||||
Q()
|
Q()
|
||||||
if zdest == wildcard
|
if zdest == wildcard
|
||||||
else Q(db_tags__db_key=str(zdest), db_tags__db_category=MAP_ZDEST_TAG_CATEGORY)
|
else Q(
|
||||||
|
db_tags__db_key__iexact=str(zdest), db_tags__db_category=MAP_ZDEST_TAG_CATEGORY
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -220,12 +221,14 @@ class XYZExitManager(XYZManager):
|
||||||
|
|
||||||
try:
|
try:
|
||||||
return (
|
return (
|
||||||
self.filter(db_tags__db_key=str(z), db_tags__db_category=MAP_Z_TAG_CATEGORY)
|
self.filter(db_tags__db_key__iexact=str(z), db_tags__db_category=MAP_Z_TAG_CATEGORY)
|
||||||
.filter(db_tags__db_key=str(x), db_tags__db_category=MAP_X_TAG_CATEGORY)
|
.filter(db_tags__db_key=str(x), db_tags__db_category=MAP_X_TAG_CATEGORY)
|
||||||
.filter(db_tags__db_key=str(y), db_tags__db_category=MAP_Y_TAG_CATEGORY)
|
.filter(db_tags__db_key=str(y), db_tags__db_category=MAP_Y_TAG_CATEGORY)
|
||||||
.filter(db_tags__db_key=str(xdest), db_tags__db_category=MAP_XDEST_TAG_CATEGORY)
|
.filter(db_tags__db_key=str(xdest), db_tags__db_category=MAP_XDEST_TAG_CATEGORY)
|
||||||
.filter(db_tags__db_key=str(ydest), db_tags__db_category=MAP_YDEST_TAG_CATEGORY)
|
.filter(db_tags__db_key=str(ydest), db_tags__db_category=MAP_YDEST_TAG_CATEGORY)
|
||||||
.filter(db_tags__db_key=str(zdest), db_tags__db_category=MAP_ZDEST_TAG_CATEGORY)
|
.filter(
|
||||||
|
db_tags__db_key__iexact=str(zdest), db_tags__db_category=MAP_ZDEST_TAG_CATEGORY
|
||||||
|
)
|
||||||
.get(**kwargs)
|
.get(**kwargs)
|
||||||
)
|
)
|
||||||
except self.model.DoesNotExist:
|
except self.model.DoesNotExist:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue