Author: esr
Date: Thu Oct 16 20:50:24 2008
New Revision: 30209

URL: http://svn.gna.org/viewcvs/wesnoth?rev=30209&view=rev
Log:
trackplacer: fix track-allocation bug when starting without filename.

Modified:
    trunk/data/tools/trackplacer

Modified: trunk/data/tools/trackplacer
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/trackplacer?rev=30209&r1=30208&r2=30209&view=diff
==============================================================================
--- trunk/data/tools/trackplacer (original)
+++ trunk/data/tools/trackplacer Thu Oct 16 20:50:24 2008
@@ -189,8 +189,8 @@
             raise IOException("Reading with tracks nonempty.", fp.name)
         if fp.name.endswith(".png") or fp.name.endswith(".jpg"):
             self.mapfile = self.properties['map'] = fp.name
-            self.selected_id = "JOURNEY"
-            self.tracks[self.selected_id] = []
+            self.add_track("JOURNEY")
+            self.modified = 0
             return
         if not fp.name.endswith(".cfg"):
             raise IOException("Cannot read this filetype.", fp.name)
@@ -301,10 +301,10 @@
             self.tracks[self.selected_id] = track[:found[-1]] + 
track[found[-1]+1:]
             self.modified += 1
     def __str__(self):
-        rep = self.mapfile + ":n"
+        rep = self.mapfile + `self.track_order`+ "\n"
         for name in self.track_order:
             track = self.tracks[name]
-            rep += name + ": " + `track` + "\n"
+            rep += name + ": " + `track` + ":\n"
         return rep
 
 class TrackEditorIcon:


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to