Explorar el Código

Good morale can no longer happen after battle is over

Ivan Savenko hace 2 años
padre
commit
9882c37ce3
Se han modificado 2 ficheros con 6 adiciones y 3 borrados
  1. 2 0
      ChangeLog.md
  2. 4 3
      server/CGameHandler.cpp

+ 2 - 0
ChangeLog.md

@@ -3,6 +3,8 @@
 ### GENERAL:
 * Fixed movement cost penalty from terrain
 * Fixed empty Black Market on game start
+* Fixed bad morale happening after waiting
+* Fixed good morale happening after defeating last enemy unit
 * RMG settings will now show all existing in game templates and not just those suitable for current settings
 * RMG settings (map size and two-level maps) that are not compatible with current template will be blocked
 * Fixed centering of scenario information window

+ 4 - 3
server/CGameHandler.cpp

@@ -6788,12 +6788,13 @@ void CGameHandler::runBattle()
 				{
 					//check for good morale
 					nextStackMorale = next->MoraleVal();
-					if(!next->hadMorale  //only one extra move per turn possible
+					if( !battleResult.get()
+						&& !next->hadMorale
 						&& !next->defending
 						&& !next->waited()
 						&& !next->fear
-						&&  next->alive()
-						&&  nextStackMorale > 0)
+						&& next->alive()
+						&& nextStackMorale > 0)
 					{
 						auto diceSize = VLC->settings()->getVector(EGameSettings::COMBAT_GOOD_MORALE_DICE);
 						size_t diceIndex = std::min<size_t>(diceSize.size()-1, nextStackMorale);