Only display 13 orders on shipment screen if there are more. More than 13 corrupts memory.

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@2457 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
SpaceViking
2008-12-15 06:26:14 +00:00
parent e95d4b8bca
commit 269b3e8bf2
+17 -2
View File
@@ -47,6 +47,7 @@
#define BOBBYR_SHIPMENT_HOME_BUTTON_Y BOBBYR_SHIPMENT_BACK_BUTTON_Y
#define BOBBYR_SHIPMENT_NUM_PREVIOUS_SHIPMENTS 13
#define MAX_SHIPMENTS_THAT_FIT_ON_SCREEN 13
@@ -155,8 +156,15 @@ BOOLEAN EnterBobbyRShipments()
{
INT32 iCnt;
// WDS - If there are more than 13 shipments only show 13 because
// that is all that will fit on the screen. If you show more things
// get corrupted.
INT32 max = giNumberOfNewBobbyRShipment;
if (max > MAX_SHIPMENTS_THAT_FIT_ON_SCREEN)
max = MAX_SHIPMENTS_THAT_FIT_ON_SCREEN;
//get the first shipment #
for( iCnt=0; iCnt<giNumberOfNewBobbyRShipment; iCnt++ )
for( iCnt=0; iCnt<max; iCnt++ )
{
if( gpNewBobbyrShipments[iCnt].fActive )
giBobbyRShipmentSelectedShipment = iCnt;
@@ -352,7 +360,14 @@ void CreatePreviousShipmentsMouseRegions()
UINT16 usHeight = GetFontHeight( BOBBYR_SHIPMENT_STATIC_TEXT_FONT );
UINT32 uiNumItems = CountNumberOfBobbyPurchasesThatAreInTransit();
for( uiCnt=0; uiCnt<uiNumItems; uiCnt++ )
// WDS - If there are more than 13 shipments only show 13 because
// that is all that will fit on the screen. If you show more things
// get corrupted.
UINT32 max = uiNumItems;
if (max > MAX_SHIPMENTS_THAT_FIT_ON_SCREEN)
max = MAX_SHIPMENTS_THAT_FIT_ON_SCREEN;
for( uiCnt=0; uiCnt<max; uiCnt++ )
{
MSYS_DefineRegion( &gSelectedPreviousShipmentsRegion[uiCnt], BOBBYR_SHIPMENT_ORDER_NUM_X, usPosY, (UINT16)(BOBBYR_SHIPMENT_ORDER_NUM_X+usWidth), (UINT16)(usPosY+usHeight), MSYS_PRIORITY_HIGH,
CURSOR_WWW, MSYS_NO_CALLBACK, SelectPreviousShipmentsRegionCallBack );