Author: elias
Date: Mon Oct 24 18:45:00 2011
New Revision: 51611

URL: http://svn.gna.org/viewcvs/wesnoth?rev=51611&view=rev
Log:
[wmlunits] Don't include addon campaigns with no units. Fixes lots of campaigns 
from the "Multipart Campaign Template" addon showing up.

Modified:
    trunk/data/tools/wmlunits

Modified: trunk/data/tools/wmlunits
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlunits?rev=51611&r1=51610&r2=51611&view=diff
==============================================================================
--- trunk/data/tools/wmlunits (original)
+++ trunk/data/tools/wmlunits Mon Oct 24 18:45:00 2011
@@ -385,7 +385,10 @@
 
             for uid, u in self.wesnoth.unit_lookup.items():
                 if u.campaign != camp: continue
-                racename = T(u.race, "plural_name")
+                if u.race:
+                    racename = T(u.race, "plural_name")
+                else:
+                    racename = "none"
                 runits = races.get(racename, [])
                 runits.append(uid)
                 races[racename] = runits
@@ -1104,6 +1107,8 @@
         p("    Parsing %s units ... " % cname)
         n = stuff.add_campaign_units(cname, image_collector)
         pn("%d units found." % n)
+        if not n:
+            del stuff.campaign_lookup[cname]
 
     mainline_campaigns = set(stuff.campaign_lookup.keys())
 
@@ -1124,6 +1129,8 @@
             p("    Parsing %s units ... " % cname)
             n = stuff.add_addon_campaign_units(cname, image_collector)
             pn("%d units found." % n)
+            if not n:
+                del stuff.campaign_lookup[cname]
 
     stuff.find_unit_factions()
 


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

Reply via email to