mirror of
https://github.com/1dot13/source.git
synced 2026-07-22 13:40:22 +02:00
BUGZILLA #548: Fixed crash (division to 0) when finishing training of mobile militia
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@4582 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -203,7 +203,11 @@ void GenerateMilitiaSquad(INT16 sMapX, INT16 sMapY, INT16 sTMapX, INT16 sTMapY,
|
||||
ubBestLeadership = __min(ubBestLeadership, gGameExternalOptions.ubReqLeadershipForFullMobileTraining);
|
||||
ubBestLeadership -= gGameExternalOptions.ubMinimumLeadershipToTrainMobileMilitia;
|
||||
|
||||
UINT8 ubBestLeadershipPercentage = (ubBestLeadership * 100) / bRange;
|
||||
UINT8 ubBestLeadershipPercentage = 0;
|
||||
if (bRange > 0)
|
||||
ubBestLeadershipPercentage = (ubBestLeadership * 100) / bRange;
|
||||
else
|
||||
bRange = 0;
|
||||
|
||||
// There are five "grades", which in practice actually give a smooth transition from All-Green to All-Elite.
|
||||
// Please note that if elite training is disabled, all elites will later be converted to Regulars. In that case,
|
||||
|
||||
Reference in New Issue
Block a user