For unit.unit = Each unit
If gGameStarted = True And unit\pathAI = userControlled Then
If unit\selected Then
unit\oldX% = unit\xLoc
unit\OldZ% = unit\yLoc
walkability (unit\xLoc,unit\yLoc) =1
If unit\xLoc <> unit\oldX Or unit\yLoc <> unit\oldZ Then walkability (unit\oldX,unit\oldZ) = 0
; Player control
PositionEntity unit\ent,unit\xLoc*MapScale,EntityY (unit\ent),unit\yLoc*MapScale
If unit\action_points =0 Then
For unit2.unit = Each unit
; If unit\id+1 = unit2\id Then
unit2\selected = True
unit\selected = False
;EndIf
Next
;FreeBank unit\pathBank
;FreeEntity unit\ent
;Delete unit
EndIf
If unit\xPath <> unit\oxPath Or unit\yPath <> unit\oyPath Then unit\action_points = unit\action_points -1 ;отнимаем очки действий
unit\oxPath = unit\xPath
unit\oyPath = unit\yPath
EndIf
EndIf
Next
нет действия для второго юнита....
сложно код построен....