From 5742725c19c9b54798d8f29cc4c0485f0b7f4d49 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 30 Jul 2013 18:02:53 +0000 Subject: [PATCH] - Fix: recent code additions broke savegame compatibility. Some code now also works for UB, as otherwise code gets needlessly complicated. - Improved code git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6260 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Laptop/LaptopSave.h | 15 +++++++-------- Laptop/laptop.cpp | 3 --- Laptop/mercs Files.cpp | Bin 145798 -> 141476 bytes Laptop/mercs.cpp | 17 +++++++---------- Laptop/mercs.h | 6 +++--- 5 files changed, 17 insertions(+), 24 deletions(-) diff --git a/Laptop/LaptopSave.h b/Laptop/LaptopSave.h index 869d3ea5..66108c17 100644 --- a/Laptop/LaptopSave.h +++ b/Laptop/LaptopSave.h @@ -125,13 +125,6 @@ typedef struct BOOLEAN fSpeckSaidFloMarriedCousinQuote; BOOLEAN fHasAMercDiedAtMercSite; -#ifdef JA2UB -#else - UINT32 uiJohnEscortedDate;// anv: Remember when Kulbas were escorted out, so John can be recruited later - BOOLEAN bJohnEscorted;// and if they were at all - UINT8 ubJohnPossibleMissedFlights;// and how many flights he already missed -#endif - #ifdef CRIPPLED_VERSION UINT8 ubCrippleFiller[20]; #endif @@ -167,7 +160,13 @@ typedef struct UINT32 uiTotalMoneyPaidToSpeck; UINT8 ubLastMercAvailableId; - UINT8 bPadding[ 86 ]; + + // Flugente: moved here. These variables always exist, as havin #ifdefs in structs is needlessly obscure + UINT32 uiJohnEscortedDate;// anv: Remember when Kulbas were escorted out, so John can be recruited later + BOOLEAN bJohnEscorted;// and if they were at all + UINT8 ubJohnPossibleMissedFlights;// and how many flights he already missed + + UINT8 bPadding[ 77 ]; // Flugente: 86->77 } LaptopSaveInfoStruct; diff --git a/Laptop/laptop.cpp b/Laptop/laptop.cpp index b30ceb6b..fbd5958d 100644 --- a/Laptop/laptop.cpp +++ b/Laptop/laptop.cpp @@ -825,13 +825,10 @@ BOOLEAN InitLaptopAndLaptopScreens() #endif LaptopSaveInfo.fBobbyRSiteCanBeAccessed = FALSE; -#ifdef JA2UB -#else //Reset Kulbas' saving date and possible missed flights LaptopSaveInfo.bJohnEscorted = FALSE; LaptopSaveInfo.uiJohnEscortedDate = 0; LaptopSaveInfo.ubJohnPossibleMissedFlights = 3; -#endif return( TRUE ); } diff --git a/Laptop/mercs Files.cpp b/Laptop/mercs Files.cpp index 575f616dcf7e4e4d52866b8b6b3ae52256cf12da..831d9ff0e8fb3f325431b1f4b23292e55f865e35 100644 GIT binary patch delta 512 zcmZqs%(3Jm#|Ew)(_cJf3(a0gvxqGAqeZlW*94H2aF}K z7slFhknzKGy^R zOwaFPG@ib0Bct5(Q&SkZrXSnPC^q>+HU}$EF+<7pze-G!(;N0MYCvSOc0go#!Lker z47NaQG~I9yqvUjl&5Q~VReXD~s4_-Zwdo)hRVHv%a?=wwGm1?AaG8;B`lGFkQrw}y zNbzF`VX$COm_C0OqbsX6gEr7Z3pX+biy}oELo7oy1H|!++Zj8d{t!IKC_Vk%0mens UwGJ{$O<(Ydk!QQlF-EIm0AUlQKmY&$ delta 652 zcmZ2-k)!Q1#|Ew)lX-TEOgB(u6qvkchsorWB`MQIG?)Y?8^p3q7TB3JS)ng$bI;B) zMsyhgh#sfiP6(L=yVrm@I_gXkn+x`oeViW9$0#)Y&ss*2>FfF!xu#EA$9QG>zx9l2 z)BAogUYI^-1Eaz81s8!5t2Q$7aHcWjGZZmsFl0_QzcdHpyrpv4Ys;7=!h7h|9aoS}? wJ-dt`b{XNcD}s7<8AI$c#%b4rO~Clt(8tI@d3>2b>@vY&m&Eq0t&CR102~|zXaE2J diff --git a/Laptop/mercs.cpp b/Laptop/mercs.cpp index 59e4dc55..ea1550d7 100644 --- a/Laptop/mercs.cpp +++ b/Laptop/mercs.cpp @@ -2616,15 +2616,12 @@ void HandleSpeckWitnessingEmployeeDeath( SOLDIERTYPE* pSoldier ) // anv: handle #endif -#ifdef JA2UB -#else - void AddJohnAsMerc() // anv: add John as playable merc after escorting Kulbas out of country - { - LaptopSaveInfo.bJohnEscorted = TRUE; - LaptopSaveInfo.uiJohnEscortedDate = GetWorldDay(); - return; - } -#endif +void AddJohnAsMerc() // anv: add John as playable merc after escorting Kulbas out of country +{ + LaptopSaveInfo.bJohnEscorted = TRUE; + LaptopSaveInfo.uiJohnEscortedDate = GetWorldDay(); + return; +} BOOLEAN ShouldSpeckSayAQuote() { @@ -2817,7 +2814,7 @@ BOOLEAN ShouldTheMercSiteServerGoDown() #else void GetMercSiteBackOnline() { - if( IsSpeckComAvailable ) + if( IsSpeckComAvailable() ) { //Add an email telling the user the site is back up AddEmail( MERC_NEW_SITE_ADDRESS, MERC_NEW_SITE_ADDRESS_LENGTH, SPECK_FROM_MERC, GetWorldTotalMin(), -1, -1 , TYPE_EMAIL_EMAIL_EDT); diff --git a/Laptop/mercs.h b/Laptop/mercs.h index f18dc26a..a5b3e3e1 100644 --- a/Laptop/mercs.h +++ b/Laptop/mercs.h @@ -160,11 +160,11 @@ void MakeBiffAwayForCoupleOfDays(); #else BOOLEAN IsSpeckComAvailable(); void HandleSpeckWitnessingEmployeeDeath( SOLDIERTYPE* pSoldier ); - - // anv: for Kulba hireable after escort quest - void AddJohnAsMerc( ); #endif +// anv: for Kulba hireable after escort quest +void AddJohnAsMerc( ); + void InitializeNumDaysMercArrive(); void NewMercsAvailableAtMercSiteCallBack( );