View Single Post
Old 05-13-07, 06:38 AM   #15
Yanaran
Watch
 
Join Date: Apr 2007
Posts: 29
Downloads: 0
Uploads: 0
Default

I'm having problems removing units from groups. Specifically I want to remove all tankers from task forces (so I can speed them up)

Code:
if group.groupName.find("TaskForce") != -1:
    for unit in group.units:
        if unit.type == UnitType.TANKER:
            group.units.remove(unit)

I get an error that says:
Traceback (innermost last)
File "<string>", line 2, in ?

Any ideas?
Yanaran is offline   Reply With Quote