From bb1c4a7b85e5ed3b81fc29118196613be3ef0fbd Mon Sep 17 00:00:00 2001 From: matrixhacker Date: Mon, 12 May 2014 14:47:45 -0400 Subject: [PATCH] Updated documentation and added an additional validation check for improperly formatted crop zones. --- docs/config.rst | 6 ++++-- overviewer_core/settingsValidators.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/config.rst b/docs/config.rst index e33e035..54ddfa1 100644 --- a/docs/config.rst +++ b/docs/config.rst @@ -709,8 +709,10 @@ values. The valid configuration keys are listed below. .. _crop: ``crop`` - You can use this to render one or more small subsets of your map, instead - of the entire thing. The format is [(min x, min z, max x, max z)]. + You can use this to render one or more small subsets of your map. The format + of an individual crop zone is (min x, min z, max x, max z); if you wish to + specify multiple crop zones, you may do so by specifying a list of crop zones, + i.e. [(min x1, min z1, max x1, max z1), (min x2, min z2, max x2, max z2)] The coordinates are block coordinates. The same you get with the debug menu in-game and the coordinates shown when you view a map. diff --git a/overviewer_core/settingsValidators.py b/overviewer_core/settingsValidators.py index 0499815..2b3d28f 100644 --- a/overviewer_core/settingsValidators.py +++ b/overviewer_core/settingsValidators.py @@ -230,7 +230,7 @@ def validateCrop(value): cropZones = [] for zone in value: - if len(zone) != 4: + if not isinstance(zone, tuple) or len(zone) != 4: raise ValidationException("The value for the 'crop' setting must be an array of tuples of length 4") a, b, c, d = tuple(int(x) for x in zone)