diff -rupN uc_restrict_qty/uc_restrict_qty.module uc_restrict_qty_new/uc_restrict_qty.module
--- uc_restrict_qty/uc_restrict_qty.module	2009-05-17 19:10:45.000000000 +1000
+++ uc_restrict_qty.module	2010-02-03 17:23:14.591204179 +1100
@@ -283,6 +283,13 @@ function uc_restrict_qty_count($form_val
   if ($data['lifetime']) {
     $bought_qty = db_result(db_query('SELECT SUM(uop.qty) FROM {uc_orders} uo LEFT JOIN {uc_order_products} uop ON uo.order_id = uop.order_id WHERE uo.order_status = "completed" AND uo.uid = %d AND uop.nid = %d ORDER BY uop.nid', $user->uid, $form_values['nid']));
     $data['rest'] = $data['qty'] - $bought_qty;
+    // Check what is currently in the users cart
+    $cart_products = uc_cart_get_contents($user->uid);
+    foreach ($cart_products as $product) {
+      if ($product->nid == $form_values['nid']) {
+        $data['rest'] -= $product->qty;
+      }
+    }
   }
 
   return $data;
