mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-12 15:45:25 +01:00
Removes Null Entry/Surplus Crates (#16788)
This commit is contained in:
@@ -521,14 +521,6 @@
|
||||
visible_message("<b>[src]</b>'s monitor flashes, \"[world.time - reqtime] seconds remaining until another requisition form may be printed.\"")
|
||||
return
|
||||
|
||||
var/datum/supply_packs/P = locateUID(params["crate"])
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
if(P.times_ordered >= P.order_limit && P.order_limit != -1) //If the crate has reached the limit, do not allow it to be ordered.
|
||||
to_chat(usr, "<span class='warning'>[P.name] is out of stock, and can no longer be ordered.</span>")
|
||||
return
|
||||
|
||||
var/amount = 1
|
||||
if(params["multiple"] == "1") // 1 is a string here. DO NOT MAKE THIS A BOOLEAN YOU DORK
|
||||
var/num_input = input(usr, "Amount", "How many crates? (20 Max)") as null|num
|
||||
@@ -536,6 +528,10 @@
|
||||
return
|
||||
amount = clamp(round(num_input), 1, 20)
|
||||
|
||||
var/datum/supply_packs/P = locateUID(params["crate"])
|
||||
if(!istype(P))
|
||||
return
|
||||
|
||||
var/timeout = world.time + 600 // If you dont type the reason within a minute, theres bigger problems here
|
||||
var/reason = input(usr, "Reason", "Why do you require this item?","") as null|text
|
||||
if(world.time > timeout || !reason || (!is_public && !is_authorized(usr)) || ..())
|
||||
@@ -576,13 +572,10 @@
|
||||
if(SO.ordernum == ordernum)
|
||||
O = SO
|
||||
P = O.object
|
||||
if(P.times_ordered >= P.order_limit && P.order_limit != -1) //If this order would put it over the limit, deny it
|
||||
to_chat(usr, "<span class='warning'>[P.name] is out of stock, and can no longer be ordered.</span>")
|
||||
else if(SSshuttle.points >= P.cost)
|
||||
if(SSshuttle.points >= P.cost)
|
||||
SSshuttle.requestlist.Cut(i,i+1)
|
||||
SSshuttle.points -= P.cost
|
||||
SSshuttle.shoppinglist += O
|
||||
P.times_ordered += 1
|
||||
investigate_log("[key_name(usr)] has authorized an order for [P.name]. Remaining points: [SSshuttle.points].", "cargo")
|
||||
else
|
||||
to_chat(usr, "<span class='warning'>There are insufficient supply points for this request.</span>")
|
||||
|
||||
Reference in New Issue
Block a user