[wmlunits] Index terrain types by the .string...

...instead of the .id field as the latter isn't unique right now.
This commit is contained in:
Elias Pschernig 2009-09-24 18:15:55 +00:00
parent 118b637074
commit 89bc70b37c
2 changed files with 4 additions and 3 deletions

View file

@ -166,8 +166,8 @@ class WesnothList:
n = 0
for terrain in WML.get_all("terrain_type"):
tid = terrain.get_text_val("id")
self.terrain_lookup[tid] = terrain
tstring = terrain.get_text_val("string")
self.terrain_lookup[tstring] = terrain
n += 1
return n

View file

@ -706,7 +706,8 @@ class HTMLOutput:
terrains = self.wesnoth.terrain_lookup
terrainlist = []
for tid, t in terrains.items():
for tstring, t in terrains.items():
tid = t.get_text_val("id")
if tid in ["off_map", "fog", "shroud"]: continue
if t.get_first("aliasof"): continue
name = t.get_text_val("name")