diff --git a/JA2.suo b/JA2.suo index 21906d31..af6cd20c 100644 Binary files a/JA2.suo and b/JA2.suo differ diff --git a/Tactical/Animation Data.cpp b/Tactical/Animation Data.cpp index 05b51ba4..8f50c2a9 100644 --- a/Tactical/Animation Data.cpp +++ b/Tactical/Animation Data.cpp @@ -746,7 +746,7 @@ BOOLEAN DeInitAnimationSystem( ) if ( gAnimSurfaceDatabase[ cnt1 ].hVideoObject != NULL ) { DeleteVideoObject( gAnimSurfaceDatabase[ cnt1 ].hVideoObject ); - gAnimSurfaceDatabase[ cnt1 ].hVideoObject = NULL; + gAnimSurfaceDatabase[ cnt1 ].hVideoObject = NULL; } } @@ -816,6 +816,12 @@ BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 { AuxObjectData *pAuxData; + if (usSurfaceIndex == 251) + { + int a = 10; + a++; + } + // Check for valid surface CHECKF( usSurfaceIndex < NUMANIMATIONSURFACETYPES ); @@ -935,6 +941,13 @@ BOOLEAN LoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex, UINT16 BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex ) { + + if (usSurfaceIndex == 251) + { + int a = 10; + a++; + } + // Decrement usage flag, only if this soldier has it currently tagged if ( gbAnimUsageHistory[ usSurfaceIndex ][ usSoldierID ] > 0 ) { @@ -960,6 +973,8 @@ BOOLEAN UnLoadAnimationSurface( UINT16 usSoldierID, UINT16 usSurfaceIndex ) gAnimSurfaceDatabase[ usSurfaceIndex ].bUsageCount = 0; } + + // Check if count has reached zero and delet if so if ( gAnimSurfaceDatabase[ usSurfaceIndex ].bUsageCount == 0 ) diff --git a/Tactical/Items.cpp b/Tactical/Items.cpp index 4bbe48ba..c35bf430 100644 --- a/Tactical/Items.cpp +++ b/Tactical/Items.cpp @@ -7536,12 +7536,25 @@ void ApplyEquipmentBonuses(SOLDIERTYPE * pSoldier) pSoldier->wornSnowCamo = (INT8)newSnowCamo; if ( (newCamo > oldCamo || newUrbanCamo > oldUrbanCamo || newDesertCamo > oldDesertCamo || newSnowCamo > oldSnowCamo )&& pSoldier->bTeam == OUR_TEAM ) + { DoMercBattleSound( pSoldier, BATTLE_SOUND_COOL1 ); - + + // WANNE: Only call the method if oldCame != newCamo + if ( pSoldier->bInSector) + CreateSoldierPalettes( pSoldier ); + } + else if ( (newCamo < oldCamo || newUrbanCamo < oldUrbanCamo || newDesertCamo < oldDesertCamo || newSnowCamo < oldSnowCamo )&& pSoldier->bTeam == OUR_TEAM ) + { + // WANNE: Only call the method if oldCame != newCamo + if ( pSoldier->bInSector) + CreateSoldierPalettes( pSoldier ); + } + // WANNE: IRA: Madd, I commented this, because this leads to IRAs INVISIBLE BUG! + // We should only call the CreateSoldierPalettes if oldCamo != newCamo. See above! //Madd: do this regardless of camo. This will need to be called to do custom part colours and new overlays anyway. - if ( pSoldier->bInSector) - CreateSoldierPalettes( pSoldier ); - + //if ( pSoldier->bInSector) + // CreateSoldierPalettes( pSoldier ); + fInterfacePanelDirty = DIRTYLEVEL2; } diff --git a/Tactical/Soldier Control.cpp b/Tactical/Soldier Control.cpp index c08f40e8..dd00bc03 100644 --- a/Tactical/Soldier Control.cpp +++ b/Tactical/Soldier Control.cpp @@ -2254,6 +2254,7 @@ BOOLEAN EVENT_InitNewSoldierAnim( SOLDIERTYPE *pSoldier, UINT16 usNewState, UINT HandleSight(pSoldier,SIGHT_LOOK); } } + // If our own guy... if ( pSoldier->bTeam == gbPlayerNum ) { diff --git a/TileEngine/renderworld.cpp b/TileEngine/renderworld.cpp index 610c1552..16eb61e9 100644 --- a/TileEngine/renderworld.cpp +++ b/TileEngine/renderworld.cpp @@ -1792,7 +1792,6 @@ void RenderTiles(UINT32 uiFlags, INT32 iStartPointX_M, INT32 iStartPointY_M, INT pShadeTable = pSoldier->pEffectShades[ 1 ]; } - hVObject=gAnimSurfaceDatabase[ usAnimSurface ].hVideoObject; if ( hVObject == NULL ) diff --git a/builddefines.h b/builddefines.h index 142d3b34..35d5b6ca 100644 --- a/builddefines.h +++ b/builddefines.h @@ -12,17 +12,18 @@ //#define JA2TESTVERSION -// Debug version of the editor! +// Remove comment to build the editor! //#define JA2EDITOR -// Editor +// Remove comment to build the editor! #ifdef _DEBUG #ifndef JA2TESTVERSION #define JA2TESTVERSION #endif #endif +// Remove comment to build the editor! // Do combinations #ifdef JA2TESTVERSION