From 9a23f84baef2a26ce48410eb23733a1300e1c18e Mon Sep 17 00:00:00 2001 From: Wanne Date: Sun, 11 May 2014 06:05:27 +0000 Subject: [PATCH] Merged from revision: 7201 Fixes (by anv) - fix: preset explosives having owner id 254, getting out of MercPtrs range and dealing no damage as a result (e.g. in Meduna Labirynth), - fix: clicking on any empty slot in team panel would select merc with id 0, - fix: switching to squad with less mercs would cause team panel to still show skill tooltips for mercs from previous squad on empty slots. git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@7202 3b4a5df2-a311-0410-b5c6-a8a6f20db521 --- Tactical/Interface Panels.cpp | 11 +++++++++++ TileEngine/Explosion Control.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Tactical/Interface Panels.cpp b/Tactical/Interface Panels.cpp index 7e039300..4de0183e 100644 --- a/Tactical/Interface Panels.cpp +++ b/Tactical/Interface Panels.cpp @@ -5863,6 +5863,12 @@ void RenderTEAMPanel( BOOLEAN fDirty ) } } + else + { + // anv: for unoccupied slots clear tooltips + SetRegionFastHelpText( &(gTEAM_FaceRegions[ cnt ]), L"" ); + SetRegionFastHelpText( &(gTEAM_BarsRegions[ cnt ]), L"" ); + } } UpdateTEAMPanel( ); @@ -6262,6 +6268,11 @@ void MercFacePanelCallback( MOUSE_REGION * pRegion, INT32 iReason ) return; } + // anv: did we click on empty panel? + if ( !gTeamPanel[ ubID ].fOccupied ) + { + return; + } // Now use soldier ID values ubSoldierID = gTeamPanel[ ubID ].ubID; diff --git a/TileEngine/Explosion Control.cpp b/TileEngine/Explosion Control.cpp index 20ff6ed4..7276e32e 100644 --- a/TileEngine/Explosion Control.cpp +++ b/TileEngine/Explosion Control.cpp @@ -1601,7 +1601,7 @@ BOOLEAN DamageSoldierFromBlast( UINT8 ubPerson, UINT8 ubOwner, INT32 sBombGridNo // SANDRO - STOMP traits else { - if ( (MercPtrs[ ubOwner ] != NULL) && gGameOptions.fNewTraitSystem) + if ( ubOwner < TOTAL_SOLDIERS && (MercPtrs[ ubOwner ] != NULL) && gGameOptions.fNewTraitSystem) { // Demolitions damage bonus with bombs and mines if ( HAS_SKILL_TRAIT( MercPtrs[ ubOwner ], DEMOLITIONS_NT ) &&