* Morale change with bounds check. * @param change can be positive or negative */
| 1501 | * @param change can be positive or negative |
| 1502 | */ |
| 1503 | void BattleUnit::moraleChange(int change) |
| 1504 | { |
| 1505 | if (!isFearable()) return; |
| 1506 | |
| 1507 | _morale += change; |
| 1508 | if (_morale > 100) |
| 1509 | _morale = 100; |
| 1510 | if (_morale < 0) |
| 1511 | _morale = 0; |
| 1512 | } |
| 1513 | |
| 1514 | /** |
| 1515 | * Mark this unit as not reselectable. |
no outgoing calls
no test coverage detected