fixed bug with cycling through enemy units
This commit is contained in:
parent
89ead17a34
commit
2f2bb402fc
1 changed files with 4 additions and 2 deletions
|
@ -895,7 +895,8 @@ bool turn_slice(game_data& gameinfo, game_state& state_of_game,
|
|||
unit_map::const_iterator it = units.find(next_unit);
|
||||
if(it != units.end()) {
|
||||
for(++it; it != units.end(); ++it) {
|
||||
if(unit_can_move(it->first,units,map,teams)) {
|
||||
if(it->second.side() == team_num &&
|
||||
unit_can_move(it->first,units,map,teams)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -903,7 +904,8 @@ bool turn_slice(game_data& gameinfo, game_state& state_of_game,
|
|||
|
||||
if(it == units.end()) {
|
||||
for(it = units.begin(); it != units.end(); ++it) {
|
||||
if(unit_can_move(it->first,units,map,teams)) {
|
||||
if(it->second.side() == team_num &&
|
||||
unit_can_move(it->first,units,map,teams)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue