| 1517 | _mouseDown = false; |
| 1518 | } |
| 1519 | } |
| 1520 | |
| 1521 | void InGameUI::SwitchToFire(EntityAI* vehicle) |
| 1522 | { |
| 1523 | if (ModeIsStrategy(_mode)) |
| 1524 | { |
| 1525 | _modeAuto = _mode = UIFire; |
| 1526 | // set cursor to current weapon direction |
| 1527 | int weapon = vehicle->SelectedWeapon(); |
| 1528 | weapon = ValidateWeapon(vehicle, weapon); |
| 1529 | |
| 1530 | if (vehicle) |
| 1531 | { |
| 1532 | AIUnit* unit = GWorld->FocusOn(); |
| 1533 | bool isObserver = unit && unit == vehicle->ObserverUnit(); |
| 1534 | bool isGunner = unit && unit == vehicle->GunnerUnit(); |
| 1535 | |
| 1536 | if (isObserver) |
| 1537 | { |
| 1538 | SetCursorDirection(vehicle->GetEyeDirection()); |
| 1539 | } |
| 1540 | else if (isGunner && weapon >= 0) |
| 1541 | { |
| 1542 | SetCursorDirection(vehicle->GetWeaponDirection(weapon)); |
| 1543 | } |
| 1544 | else |
| 1545 | { |
| 1546 | SetCursorDirection(vehicle->Direction()); |
| 1547 | } |
| 1548 | _worldCursorTime = Glob.uiTime; |
| 1549 | } |
| 1550 | |
| 1551 | _dragging = false; |
| 1552 | _mouseDown = false; |
| 1553 | } |
| 1554 | } |
| 1555 |
nothing calls this directly
no test coverage detected