Minor Chem Master tweaks (#21904)

* Make chem dispenser transfer to beaker by default

* Fix chem masters' default product name when supplied invalid product number
This commit is contained in:
Nathan Winters
2023-08-16 20:34:07 +01:00
committed by GitHub
parent d1d0effa0a
commit c0def97ec3
@@ -4,6 +4,9 @@
#define MAX_UNITS_PER_PATCH 30 // Max amount of units in a patch
#define MAX_CUSTOM_NAME_LEN 64 // Max length of a custom pill/condiment/whatever
#define TRANSFER_TO_DISPOSAL 0
#define TRANSFER_TO_BEAKER 1
/obj/machinery/chem_master
name = "\improper ChemMaster 3000"
density = TRUE
@@ -15,7 +18,7 @@
var/obj/item/reagent_containers/beaker = null
var/obj/item/storage/pill_bottle/loaded_pill_bottle = null
var/mode = 0
var/mode = TRANSFER_TO_BEAKER
var/condi = FALSE
var/useramount = 30 // Last used amount
var/pillamount = 10
@@ -351,7 +354,7 @@
if("create_pill")
if(condi || !reagents.total_volume)
return
var/num = round(text2num(arguments["num"] || 1))
var/num = clamp(round(text2num(arguments["num"])), 0, MAX_MULTI_AMOUNT)
if(!num)
return
arguments["num"] = num
@@ -371,7 +374,7 @@
if("create_patch")
if(condi || !reagents.total_volume)
return
var/num = round(text2num(arguments["num"] || 1))
var/num = clamp(round(text2num(arguments["num"])), 0, MAX_MULTI_AMOUNT)
if(!num)
return
arguments["num"] = num
@@ -437,7 +440,7 @@
if("create_pill")
if(condi || !reagents.total_volume)
return
var/count = clamp(round(text2num(arguments["num"]) || 0), 0, MAX_MULTI_AMOUNT)
var/count = text2num(arguments["num"])
if(!count)
return
@@ -470,7 +473,7 @@
if("create_patch")
if(condi || !reagents.total_volume)
return
var/count = clamp(round(text2num(arguments["num"]) || 0), 0, MAX_MULTI_AMOUNT)
var/count = text2num(arguments["num"])
if(!count)
return
@@ -560,3 +563,6 @@
#undef MAX_UNITS_PER_PILL
#undef MAX_UNITS_PER_PATCH
#undef MAX_CUSTOM_NAME_LEN
#undef TRANSFER_TO_DISPOSAL
#undef TRANSFER_TO_BEAKER