Skip to content

Instantly share code, notes, and snippets.

@nihathrael
Created November 13, 2013 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nihathrael/7457564 to your computer and use it in GitHub Desktop.
Save nihathrael/7457564 to your computer and use it in GitHub Desktop.
(23:15:53) $ git diff
diff --git a/horizons/world/__init__.py b/horizons/world/__init__.py
index 0556cf0..1da75cf 100644
--- a/horizons/world/__init__.py
+++ b/horizons/world/__init__.py
@@ -290,6 +290,8 @@ class World(BuildingOwner, WorldObject):
self.min_y -= self.map_padding
self.max_x += self.map_padding
self.max_y += self.map_padding
+ print self.min_x, self.min_y, self.max_x, self.max_y
+ print type(self.min_x), type(self.min_y), type(self.max_x),type(self.max_y)
self.map_dimensions = Rect.init_from_borders(self.min_x, self.min_y, self.max_x, self.max_y)
# Load islands.
@@ -297,6 +299,20 @@ class World(BuildingOwner, WorldObject):
island = Island(savegame_db, islandid, self.session, preview=preview)
self.islands.append(island)
+# self.min_x, self.min_y, self.max_x, self.max_y = 0, 0, 0, 0
+# for island in self.islands:
+# self.min_x = min(island.position.left, self.min_x)
+# self.min_y = min(island.position.top, self.min_y)
+# self.max_x = max(island.position.right, self.max_x)
+# self.max_y = max(island.position.bottom, self.max_y)
+#
+# self.min_x -= self.map_padding
+# self.min_y -= self.map_padding
+# self.max_x += self.map_padding
+# self.max_y += self.map_padding
+ print self.min_x, self.min_y, self.max_x, self.max_y
+ print type(self.min_x), type(self.min_y), type(self.max_x),type(self.max_y)
+
# Add water.
self.log.debug("Filling world with water...")
self.ground_map = {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment