MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / moraleChange

Method moraleChange

src/Savegame/BattleUnit.cpp:1503–1512  ·  view source on GitHub ↗

* Morale change with bounds check. * @param change can be positive or negative */

Source from the content-addressed store, hash-verified

1501 * @param change can be positive or negative
1502 */
1503void 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.

Callers 4

checkForCasualtiesMethod · 0.80
handlePanickingUnitMethod · 0.80
hitMethod · 0.80
psiAttackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected