Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cap quantity at inventory limit.

TODO: make sure item is entered before quantity.
  • Loading branch information...
commit d47359a2a830c857a7abc9fa048d6a6cb7a48c22 1 parent 5ec177f
@rahulg authored
Showing with 7 additions and 0 deletions.
  1. +7 −0 timer.asm
View
7 timer.asm
@@ -127,6 +127,7 @@ UPDATE_CASH_DISPLAY PROC FAR
UPDATE_CASH_DISPLAY_LOOP:
MOV AX, DS:DISPLAY_PASS
+
XOR DX, DX
DIV CX
@@ -854,6 +855,12 @@ M_TXN_IDLE:
TEST AH, AH
JNZ M_TXN_QTYBOOM
+ ; Hard cap at inventory limit
+ XOR BH, BH
+ MOV BL, DS:TXN_ITEM
+ CMP AL, DS:ITEM_INVENTORY[BX]
+ JA M_TXN_QTYBOOM
+
ADD AL, BL
MOV DS:TXN_QTY, AL
Please sign in to comment.
Something went wrong with that request. Please try again.