From fa0c5a2862ddde9c31a3b045a7b4dc62ca979a02 Mon Sep 17 00:00:00 2001 From: Asdow <20314541+Asdow@users.noreply.github.com> Date: Sat, 26 Apr 2025 00:23:02 +0300 Subject: [PATCH] Prevent hiring MERC in UB if not enough funds --- Laptop/mercs Files.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index 4ef50fd5..159161d7 100644 --- a/Laptop/mercs Files.cpp +++ b/Laptop/mercs Files.cpp @@ -1203,6 +1203,22 @@ BOOLEAN MercFilesHireMerc(UINT8 ubMercID) return(FALSE);//not enough big ones $$$sATMText } +#ifdef JA2UB + Namount = 0; + Namount += gMercProfiles[ubMercID].uiWeeklySalary; + if ( gSelectedMercKit > 0 ) + { + Namount += gMercProfiles[ubMercID].usOptionalGearCost; + } + + if ( Namount > LaptopSaveInfo.iCurrentBalance ) + { + DoLapTopMessageBox( MSG_BOX_LAPTOP_DEFAULT, sATMText[4], LAPTOP_SCREEN, MSG_BOX_FLAG_OK, NULL ); + return(FALSE);//not enough big ones $$$sATMText + } +#endif // JA2UB + + bReturnCode = HireMerc( &HireMercStruct ); //already have limit of mercs on the team