@@ -142,9 +142,10 @@ def add_ability(self, ability_id, name, title=None, is_build=False, build_time=N
142
142
setattr (self , name , ability )
143
143
self .abilities [ability_id ] = ability
144
144
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 ):
146
146
unit = type (name ,(Unit ,), dict (
147
147
id = type_id ,
148
+ str_id = str_id ,
148
149
name = name ,
149
150
title = title or name ,
150
151
race = race ,
@@ -157,6 +158,7 @@ def add_unit_type(self, type_id, name, title=None, race='Neutral', minerals=0, v
157
158
))
158
159
setattr (self , name , unit )
159
160
self .units [type_id ] = unit
161
+ self .units [str_id ] = unit
160
162
161
163
def load_build (expansion , version ):
162
164
build = Build (version )
@@ -168,7 +170,7 @@ def load_build(expansion, version):
168
170
unit_type = int (int_id ,10 )
169
171
title = UNIT_LOOKUP [str_id ]
170
172
171
- values = dict (type_id = unit_type , name = title )
173
+ values = dict (type_id = unit_type , str_id = str_id , name = title )
172
174
for race in ('Protoss' ,'Terran' ,'Zerg' ):
173
175
if title .lower () in unit_lookup [race ]:
174
176
values .update (unit_lookup [race ][title .lower ()])
0 commit comments