Fix for ammo icon in description box which showed another shifted description box when ammo type was invalid.

http://www.ja-galaxy-forum.com/board/ubbthreads.php/topics/328324/Re:_BUGZILLA_report_all_bugs_h.html#Post328324

Ammo type of such weapons will now be reset to 0 (standard ball ammo).


git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@6798 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
silversurfer
2014-01-20 17:38:35 +00:00
parent 762f1074f3
commit 603550b5ae
+6
View File
@@ -5147,6 +5147,12 @@ BOOLEAN InternalInitItemDescriptionBox( OBJECTTYPE *pObject, INT16 sX, INT16 sY,
FilenameForBPP("INTERFACE\\infobox.sti", ubString);
sForeColour = ITEMDESC_AMMO_FORE;
// silversurfer: This should never happen but some maps may contain items with invalid ammo types and this leads to graphical glitches
// because the game cannot find the right ammo icon in infobox.sti and then uses index 0. Index 0 is the info box itself.
// Better reset ammo type to 0 which is standard ball ammo.
if ( AmmoTypes[(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType].grayed == 0 || AmmoTypes[(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType].offNormal == 0 || AmmoTypes[(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType].onNormal == 0 )
(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType = 0;
giItemDescAmmoButtonImages = LoadButtonImage(ubString,AmmoTypes[(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType].grayed,AmmoTypes[(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType].offNormal,-1,AmmoTypes[(*pObject)[ubStatusIndex]->data.gun.ubGunAmmoType].onNormal,-1 );
if( guiCurrentItemDescriptionScreen == MAP_SCREEN )