src/game/Laptop/BobbyR.cc
static UINT8 HowManyBRItemsToOrder(UINT16 usItemIndex, UINT8 ubCurrentlyOnHand, UINT8 ubBobbyRayNewUsed)
{
	UINT8	ubItemsOrdered = 0;

	const DealerInventory *inv = ubBobbyRayNewUsed ? GCM->getBobbyRayUsedInventory() : GCM->getBobbyRayNewInventory();
	const ItemModel *item = GCM->getItem(usItemIndex);

	Assert(usItemIndex < MAXITEMS);
	// formulas below will fail if there are more items already in stock than optimal
	Assert(ubCurrentlyOnHand <= inv->getMaxItemAmount(item));
	Assert(ubBobbyRayNewUsed < BOBBY_RAY_LISTS);


	// decide if he can get stock for this item (items are reordered an entire batch at a time)
	if (ItemTransactionOccurs(ARMS_DEALER_BOBBYR, usItemIndex, DEALER_BUYING, ubBobbyRayNewUsed))
	{
		if (ubBobbyRayNewUsed == BOBBY_RAY_NEW)
		{
			ubItemsOrdered = HowManyItemsToReorder(inv->getMaxItemAmount(item), ubCurrentlyOnHand);
		}
		else
		{
			//Since these are used items we only should order 1 of each type
			ubItemsOrdered = 1;
		}
	}
	else
	{
		// can't obtain this item from suppliers
		ubItemsOrdered = 0;
	}


	return(ubItemsOrdered);
}
//returns the number of items to order
returns the number of items to order
returns the number of items to order
static UINT8 HowManyBRItemsToOrder(UINT16 usItemIndex, UINT8 ubCurrentlyOnHand, UINT8 ubBobbyRayNewUsed)
{
	UINT8	ubItemsOrdered = 0;
	const DealerInventory *inv = ubBobbyRayNewUsed ? GCM->getBobbyRayUsedInventory() : GCM->getBobbyRayNewInventory();
	const ItemModel *item = GCM->getItem(usItemIndex);
	Assert(usItemIndex < MAXITEMS);
	Assert(ubCurrentlyOnHand <= inv->getMaxItemAmount(item));
	Assert(ubBobbyRayNewUsed < BOBBY_RAY_LISTS);
	if (ItemTransactionOccurs(ARMS_DEALER_BOBBYR, usItemIndex, DEALER_BUYING, ubBobbyRayNewUsed))
	{
		if (ubBobbyRayNewUsed == BOBBY_RAY_NEW)
		{
			ubItemsOrdered = HowManyItemsToReorder(inv->getMaxItemAmount(item), ubCurrentlyOnHand);
		}
		else
		{
			ubItemsOrdered = 1;
		}
	}
	else
	{
		ubItemsOrdered = 0;
	}
	return(ubItemsOrdered);
}
static UINT8 HowManyBRItemsToOrder ( UINT16 usItemIndex , UINT8 ubCurrentlyOnHand , UINT8 ubBobbyRayNewUsed ) { UINT8 ubItemsOrdered = 0 ; const DealerInventory * inv = ubBobbyRayNewUsed ? GCM -> getBobbyRayUsedInventory ( ) : GCM -> getBobbyRayNewInventory ( ) ; const ItemModel * item = GCM -> getItem ( usItemIndex ) ; Assert ( usItemIndex < MAXITEMS ) ; Assert ( ubCurrentlyOnHand <= inv -> getMaxItemAmount ( item ) ) ; Assert ( ubBobbyRayNewUsed < BOBBY_RAY_LISTS ) ; if ( ItemTransactionOccurs ( ARMS_DEALER_BOBBYR , usItemIndex , DEALER_BUYING , ubBobbyRayNewUsed ) ) { if ( ubBobbyRayNewUsed == BOBBY_RAY_NEW ) { ubItemsOrdered = HowManyItemsToReorder ( inv -> getMaxItemAmount ( item ) , ubCurrentlyOnHand ) ; } else { ubItemsOrdered = 1 ; } } else { ubItemsOrdered = 0 ; } return ( ubItemsOrdered ) ; }
returns the number of items to order
returns the number of items to order
// formulas below will fail if there are more items already in stock than optimal // decide if he can get stock for this item (items are reordered an entire batch at a time) //Since these are used items we only should order 1 of each type // can't obtain this item from suppliers