changeset 554:679962cfcec3

more fixes after big import changes
author davidbyron
date Sun, 04 Apr 2010 02:29:20 -0500
parents 352dd34444e7
children d1839c1a8bd4
files orpg/mapper/map.py orpg/mapper/whiteboard.py
diffstat 2 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/orpg/mapper/map.py	Sat Apr 03 00:38:00 2010 -0500
+++ b/orpg/mapper/map.py	Sun Apr 04 02:29:20 2010 -0500
@@ -26,7 +26,7 @@
 # Description:
 #
 from __future__ import with_statement
-
+import string
 import random
 import os
 import thread
@@ -843,7 +843,7 @@
         if d.ShowModal() == wx.ID_OK:
             fn = d.GetPath()
             #make sure the filename ends with .xml
-            if not (lower(fn)).endswith(".xml"):
+            if not fn.lower().endswith(".xml"):
                 fn = fn + '.xml'
 
             with open(fn, "w") as f:
--- a/orpg/mapper/whiteboard.py	Sat Apr 03 00:38:00 2010 -0500
+++ b/orpg/mapper/whiteboard.py	Sun Apr 04 02:29:20 2010 -0500
@@ -203,7 +203,7 @@
             for j in range(i+1, len(self.points)-1):
                 b = self.points[j]
                 c = self.points[j+1]
-                if orpg.mapper.map_utils.proximity_test(a, c, b, 0.5):
+                if proximity_test(a, c, b, 0.5):
                     i += 1
                 else:
                     break;
@@ -224,7 +224,7 @@
         if self.points != []:
             a = self.points[0]
             for b in self.points[1:]:
-                if orpg.mapper.map_utils.proximity_test(a, b, pt, 12):
+                if proximity_test(a, b, pt, 12):
                     return True
                 a = b
         return False
@@ -276,7 +276,7 @@
         # the following lines may seem odd but are added to be backwards compatible with
         # OpenRPG 1.8.0.X and earlier.  The last point was always repeated and variables
         # upperleftx, upperlefty, lowerrightx, lowerrighty were mandatory (though unused).
-        if self.points[-1] != self.points[-2]:
+        if len(self.points)==1 or self.points[-1] != self.points[-2]:
             line_string += ";"+str(self.points[-1][0])+","+str(self.points[-1][1])
         xml_str += " upperleftx='0' upperlefty='0' lowerrightx='0' lowerrighty='0'"
         ########