From b70fcbe5e673fbfc6133da8088b76024c91204b2 Mon Sep 17 00:00:00 2001 From: Flugente Date: Tue, 24 Jul 2018 21:04:29 +0000 Subject: [PATCH] Fix: compile error git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8587 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Soldier Profile.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/Tactical/Soldier Profile.cpp b/Tactical/Soldier Profile.cpp index e2835497..60062c13 100644 --- a/Tactical/Soldier Profile.cpp +++ b/Tactical/Soldier Profile.cpp @@ -2369,11 +2369,20 @@ BOOLEAN MercIsInTropicalSector( SOLDIERTYPE * pSoldier ) SOLDIERTYPE * SwapLarrysProfiles( SOLDIERTYPE * pSoldier ) { - MERCPROFILESTRUCT* pNewProfile; - UINT8 ubSrcProfile = pSoldier->ubProfile; + UINT8 ubSrcProfile; + UINT8 ubDestProfile; + MERCPROFILESTRUCT * pNewProfile; - // need a stop criteria... - if ( FALSE ) + ubSrcProfile = pSoldier->ubProfile; + if ( ubSrcProfile == LARRY_NORMAL ) + { + ubDestProfile = LARRY_DRUNK; + } + else if ( ubSrcProfile == LARRY_DRUNK ) + { + ubDestProfile = LARRY_NORMAL; + } + else { // I don't think so! return( pSoldier ); @@ -2449,7 +2458,7 @@ SOLDIERTYPE * SwapLarrysProfiles( SOLDIERTYPE * pSoldier ) pNewProfile->sTrueSalary = gMercProfiles[ ubSrcProfile ].sTrueSalary; // the goodguy property is permanent and shouldn't carry over, so check for that - BOOLEAN goodguy = ( gMercProfiles[ubDestProfile].ubMiscFlags3 & PROFILE_MISC_FLAG3_GOODGUY ) ? TRUE : FALSE; + BOOLEAN goodguy = ( (gMercProfiles[ubDestProfile].ubMiscFlags3) & PROFILE_MISC_FLAG3_GOODGUY ) ? TRUE : FALSE; pNewProfile->ubMiscFlags3 = gMercProfiles[ ubSrcProfile ].ubMiscFlags3;