This commit is contained in:
Kelenius
2016-01-27 13:30:13 +03:00
parent b972ff9d21
commit 6de7243862
+6 -11
View File
@@ -115,21 +115,21 @@
if(href_list["amount"])
var/id = href_list["add"]
var/amount = isgoodnumber(text2num(href_list["amount"]))
var/amount = Clamp((text2num(href_list["amount"])), 0, 200)
R.trans_id_to(src, id, amount)
else if (href_list["addcustom"])
var/id = href_list["addcustom"]
useramount = input("Select the amount to transfer.", 30, useramount) as num
useramount = isgoodnumber(useramount)
useramount = Clamp(useramount, 0, 200)
src.Topic(null, list("amount" = "[useramount]", "add" = "[id]"))
else if (href_list["remove"])
if(href_list["amount"])
var/id = href_list["remove"]
var/amount = isgoodnumber(text2num(href_list["amount"]))
var/amount = Clamp((text2num(href_list["amount"])), 0, 200)
if(mode)
reagents.trans_id_to(beaker, id, amount)
else
@@ -140,7 +140,7 @@
var/id = href_list["removecustom"]
useramount = input("Select the amount to transfer.", 30, useramount) as num
useramount = isgoodnumber(useramount)
useramount = Clamp(useramount, 0, 200)
src.Topic(null, list("amount" = "[useramount]", "remove" = "[id]"))
else if (href_list["toggle"])
@@ -162,7 +162,8 @@
return
if (href_list["createpill_multiple"])
count = Clamp(isgoodnumber(input("Select the number of pills to make.", 10, pillamount) as num),1,max_pill_count)
count = input("Select the number of pills to make.", "Max [max_pill_count]", pillamount) as num
count = Clamp(count, 1, max_pill_count)
if(reagents.total_volume/count < 1) //Sanity checking.
return
@@ -291,12 +292,6 @@
onclose(user, "chem_master")
return
/obj/machinery/chem_master/proc/isgoodnumber(var/num)
if(isnum(num))
return Clamp(round(num), 0, 200)
else
return 0
/obj/machinery/chem_master/condimaster
name = "CondiMaster 3000"
condi = 1