@@ -142,9 +142,10 @@ def add_ability(self, ability_id, name, title=None, is_build=False, build_time=N
142142 setattr (self , name , ability )
143143 self .abilities [ability_id ] = ability
144144
145- def add_unit_type (self , type_id , name , title = None , race = 'Neutral' , minerals = 0 , vespene = 0 , supply = 0 , is_building = False , is_worker = False , is_army = False ):
145+ def add_unit_type (self , type_id , str_id , name , title = None , race = 'Neutral' , minerals = 0 , vespene = 0 , supply = 0 , is_building = False , is_worker = False , is_army = False ):
146146 unit = type (name ,(Unit ,), dict (
147147 id = type_id ,
148+ str_id = str_id ,
148149 name = name ,
149150 title = title or name ,
150151 race = race ,
@@ -157,6 +158,7 @@ def add_unit_type(self, type_id, name, title=None, race='Neutral', minerals=0, v
157158 ))
158159 setattr (self , name , unit )
159160 self .units [type_id ] = unit
161+ self .units [str_id ] = unit
160162
161163def load_build (expansion , version ):
162164 build = Build (version )
@@ -168,7 +170,7 @@ def load_build(expansion, version):
168170 unit_type = int (int_id ,10 )
169171 title = UNIT_LOOKUP [str_id ]
170172
171- values = dict (type_id = unit_type , name = title )
173+ values = dict (type_id = unit_type , str_id = str_id , name = title )
172174 for race in ('Protoss' ,'Terran' ,'Zerg' ):
173175 if title .lower () in unit_lookup [race ]:
174176 values .update (unit_lookup [race ][title .lower ()])
0 commit comments