diff --git a/GameVersion.cpp b/GameVersion.cpp index fc43b249..b9d9d430 100644 --- a/GameVersion.cpp +++ b/GameVersion.cpp @@ -23,7 +23,7 @@ INT16 zVersionLabel[256] = { L"Beta v. 0.98" }; #else //RELEASE BUILD VERSION - INT16 zVersionLabel[256] = { L"Release v1.13.679" }; + INT16 zVersionLabel[256] = { L"Release v1.13.684" }; #endif diff --git a/JA2.vcproj b/JA2.vcproj index 09db4861..95061895 100644 --- a/JA2.vcproj +++ b/JA2.vcproj @@ -546,7 +546,7 @@ usAttachItem[ cnt ],gpItemDescObject->usItem); + //lalien: changed to charge AP's for reloading a GL/RL + if ( Item[ gpItemDescObject->usItem ].usItemClass == IC_LAUNCHER || Item[gpItemDescObject->usItem].cannon ) + { + ubAPCost = GetAPsToReload( gpItemDescObject ); + } + else + { + ubAPCost = AttachmentAPCost(gpItemDescObject->usAttachItem[ cnt ],gpItemDescObject->usItem); + } + fAllFound = FALSE; break; } @@ -4178,7 +4187,7 @@ void DeleteItemDescriptionBox( ) //Remove DeleteVideoObjectFromIndex( guiItemDescBox ); - DeleteVideoObjectFromIndex( guiMapItemDescBox ); + DeleteVideoObjectFromIndex( guiMapItemDescBox ); DeleteVideoObjectFromIndex( guiBullet ); // Delete item graphic DeleteVideoObjectFromIndex( guiItemGraphic ); diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index aba95e5a..732f078a 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -2586,15 +2586,15 @@ BOOLEAN PlaceObjectAtObjectIndex( OBJECTTYPE * pSourceObj, OBJECTTYPE * pTargetO BOOLEAN ReloadGun( SOLDIERTYPE * pSoldier, OBJECTTYPE * pGun, OBJECTTYPE * pAmmo ) { - OBJECTTYPE OldAmmo; - UINT8 ubBulletsToMove; - INT8 bAPs; + OBJECTTYPE OldAmmo; + UINT8 ubBulletsToMove; + INT8 bAPs; UINT16 usReloadSound; BOOLEAN fSameAmmoType; BOOLEAN fSameMagazineSize; BOOLEAN fReloadingWithStack; BOOLEAN fEmptyGun; - INT8 bReloadType; + INT8 bReloadType; UINT16 usNewAmmoItem; if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) ) @@ -3183,7 +3183,8 @@ BOOLEAN AttachObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pTargetObj, OBJECTTYP UINT8 ubType, ubLimit, ubAPCost; INT32 iCheckResult; INT8 bAttachInfoIndex = -1, bAttachComboMerge; - BOOLEAN fValidLaunchable = FALSE; + BOOLEAN fValidLaunchable = FALSE; + BOOLEAN IsAGLorRL = FALSE; if ( pTargetObj->ubNumberOfObjects > 1 ) @@ -3227,11 +3228,27 @@ BOOLEAN AttachObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pTargetObj, OBJECTTYP } //lalien: added to make a GL/RL work when reloaded manually + // the AP costs for reloading GL/RL will be taken from weapons.xml ( wrong place!!! the AP's are deducted in DeleteItemDescriptionBox() ) if (bAttachPos != ITEM_NOT_FOUND) { if ( Item[ pTargetObj->usItem ].usItemClass == IC_LAUNCHER || Item[pTargetObj->usItem].cannon ) { - pTargetObj->usGunAmmoItem = pAttachment->usItem; + //if ( (gTacticalStatus.uiFlags & TURNBASED) && (gTacticalStatus.uiFlags & INCOMBAT) ) + //{ + // INT8 bAPs = GetAPsToReloadGunWithAmmo( pTargetObj, pAttachment ); + // + // if ( !EnoughPoints( pSoldier, bAPs, 0,TRUE ) ) + // { + // return( FALSE ); + // } + // else + // { + // DeductPoints( pSoldier, bAPs, 0 ); + // IsAGLorRL = TRUE; + // } + //} + + pTargetObj->usGunAmmoItem = pAttachment->usItem; } } @@ -3353,7 +3370,11 @@ BOOLEAN AttachObject( SOLDIERTYPE * pSoldier, OBJECTTYPE * pTargetObj, OBJECTTYP return( FALSE ); } - DeductPoints( pSoldier, ubAPCost, 0 ); + //lalien: don't charge AP's for reloading a GL/RL ( wrong place!!! the AP's are deducted in DeleteItemDescriptionBox() ) + //if ( IsAGLorRL == FALSE ) + //{ + DeductPoints( pSoldier, ubAPCost, 0 ); + //} } switch( ubType )