From d867051cd65b02d5493b95fb26e95f2a83eaa062 Mon Sep 17 00:00:00 2001 From: silversurfer Date: Fri, 16 Oct 2020 07:52:46 +0000 Subject: [PATCH] fix: when multiple mercs are repairing, it could happen that one of them didn't spend any points, causing an error message about insufficient skill git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8900 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- GameVersion.cpp | 4 ++-- Strategic/Assignments.cpp | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/GameVersion.cpp b/GameVersion.cpp index 0791f4d4..a5c58655 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -55,8 +55,8 @@ #endif -CHAR8 czVersionNumber[16] = { "Build 20.08.01" }; //YY.MM.DD +CHAR8 czVersionNumber[16] = { "Build 20.10.16" }; //YY.MM.DD CHAR16 zTrackingNumber[16] = { L"Z" }; -CHAR16 zRevisionNumber[16] = { L"Revision 8875" }; +CHAR16 zRevisionNumber[16] = { L"Revision 8900" }; // SAVE_GAME_VERSION is defined in header, change it there diff --git a/Strategic/Assignments.cpp b/Strategic/Assignments.cpp index dd49db9c..b137df75 100644 --- a/Strategic/Assignments.cpp +++ b/Strategic/Assignments.cpp @@ -5646,18 +5646,19 @@ void HandleRepairBySoldier( SOLDIERTYPE *pSoldier ) bRepairing = TRUE; } - // if nothing got repaired or cleaned, there's a problem - if ( ubRepairPtsUsed == 0 && ubCleaningPtsUsed == 0 ) - { - // he can't repair anything because he doesn't have enough skill! - AssignmentAborted( pSoldier, INSUF_REPAIR_SKILL ); - } // nothing more to do? - else if ( !bCleaning && !bRepairing ) + if ( !bCleaning && !bRepairing ) { AssignmentDone( pSoldier, TRUE, TRUE ); StopTimeCompression(); } + // if nothing got repaired or cleaned, there's a problem + else if (ubRepairPtsUsed == 0 && ubCleaningPtsUsed == 0) + { + // he can't repair anything because he doesn't have enough skill! + AssignmentAborted(pSoldier, INSUF_REPAIR_SKILL); + StopTimeCompression(); + } } BOOLEAN IsItemRepairable(SOLDIERTYPE* pSoldier, UINT16 usItem, INT16 bStatus, INT16 bThreshold )