Fixes removing the last item on an order on the cash register and quikpay. (#21558)

A small oversight from my cash register PR, this fixes that.
This commit is contained in:
Casper3667
2025-11-10 07:38:36 +00:00
committed by GitHub
parent 094d4ffbfa
commit f02d02cb31
3 changed files with 10 additions and 2 deletions
+1 -1
View File
@@ -294,7 +294,7 @@
if(L["amount"] > 1)
L["amount"]--
else
items.Cut(index, index+1)
buying.Cut(index, index+1)
. = TRUE
if("confirm")
+3 -1
View File
@@ -179,12 +179,14 @@
buying += list(list("name" = params["buying"], "amount" = params["amount"]))
if("removal")
var/index = 0
for(var/list/L in buying)
index++
if(L["name"] == params["removal"])
if(L["amount"] > 1)
L["amount"]--
else
buying -= L
buying.Cut(index, index+1)
. = TRUE
if("confirm")