mirror of
https://github.com/1dot13/source.git
synced 2026-08-12 14:10:23 +02:00
Fix: crash if player offer area exceeds 255 fields (possible on high resolutions)
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8823 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
@@ -1515,23 +1515,23 @@ bool ItemIsSpecial(DEALER_SPECIAL_ITEM& item)
|
||||
return false;
|
||||
}
|
||||
|
||||
UINT16 CountTotalItemsRepairDealerHasInForRepairs( UINT8 ubArmsDealer )
|
||||
int CountTotalItemsRepairDealerHasInForRepairs( UINT8 ubArmsDealer )
|
||||
{
|
||||
//if the dealer is not a repair dealer, no need to count, return 0
|
||||
if ( !DoesDealerDoRepairs( ubArmsDealer ) )
|
||||
return 0;
|
||||
|
||||
UINT16 usHowManyInForRepairs = 0;
|
||||
int count = 0;
|
||||
|
||||
for ( DealerItemList::iterator iter = gArmsDealersInventory[ubArmsDealer].begin(); iter != gArmsDealersInventory[ubArmsDealer].end(); ++iter )
|
||||
{
|
||||
if ( iter->object.exists() && iter->IsUnderRepair() )
|
||||
{
|
||||
++usHowManyInForRepairs;
|
||||
++count;
|
||||
}
|
||||
}
|
||||
|
||||
return( usHowManyInForRepairs );
|
||||
return( count );
|
||||
}
|
||||
|
||||
void AddObjectToArmsDealerInventory( UINT8 ubArmsDealer, OBJECTTYPE *pObject )
|
||||
|
||||
Reference in New Issue
Block a user