diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm index d8d0080ec41..1e6f90f37f6 100644 --- a/code/game/mecha/mech_fabricator.dm +++ b/code/game/mecha/mech_fabricator.dm @@ -460,10 +460,11 @@ var/amount = text2num(href_list["remove_mat"]) var/material = href_list["material"] if(href_list["custom_eject"]) - amount = input("How much?", "How many sheets would you like to eject from the machine?", 1) as null|num + amount = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num amount = max(0,min(round(resources[material]/MINERAL_MATERIAL_AMOUNT),amount)) // Rounding errors aren't scary, as the mineral eject proc is smart if (!amount) return + amount = round(amount) if(amount < 0 || amount > resources[material]) //href protection, except that resources[] is 2000 per sheet return diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm index 6129ea65c91..4af83bb523d 100644 --- a/code/game/objects/items/stacks/stack.dm +++ b/code/game/objects/items/stacks/stack.dm @@ -196,9 +196,10 @@ /obj/item/stack/attack_hand(mob/user as mob) if (user.get_inactive_hand() == src) - var/desired = input("How much?", "How much would you like to grab from the stack?", 1) as null|num + var/desired = input("How much would you like to grab from the stack?", "How much?", 1) as null|num if(!desired) return + desired = round(desired) desired = max(1,min(desired,src.max_amount,src.amount)) var/obj/item/stack/F = new src.type( user, desired) F.copy_evidences(src) @@ -221,9 +222,10 @@ return 1 var/to_transfer as num if (user.get_inactive_hand()==src) - var/desired = input("How much?", "How much would you like to grab from the stack?", 1) as null|num + var/desired = input("How much would you like to grab from the stack?", "How much?", 1) as null|num if(!desired) return + desired = round(desired) to_transfer = max(1,min(desired,S.max_amount-S.amount,src.amount)) else to_transfer = min(src.amount, S.max_amount-S.amount) diff --git a/code/game/vehicles/spacepods/pod_fabricator.dm b/code/game/vehicles/spacepods/pod_fabricator.dm index fcc65870b1e..4a52f06be48 100644 --- a/code/game/vehicles/spacepods/pod_fabricator.dm +++ b/code/game/vehicles/spacepods/pod_fabricator.dm @@ -8,7 +8,7 @@ use_power = 1 idle_power_usage = 20 active_power_usage = 5000 - req_access = list(access_robotics) + req_access = list(access_mechanic) var/time_coeff = 1 var/resource_coeff = 1 var/time_coeff_tech = 1 @@ -155,9 +155,9 @@ var/output for(var/resource in resources) var/amount = min(res_max_amount, resources[resource]) - output += "[material2name(resource)]: [amount] cm³" + output += "[material2name(resource)]: [amount] cm³, [round(resources[resource] / MINERAL_MATERIAL_AMOUNT,0.1)] sheets" if(amount>0) - output += " - Remove \[1\] | \[10\] | \[All\]" + output += " - Remove \[1\] | \[10\] | \[Custom\] | \[All\]" output += "
" return output @@ -322,8 +322,12 @@ return round(initial(D.construction_time)*time_coeff*time_coeff_tech, roundto) /obj/machinery/spod_part_fabricator/attack_hand(mob/user) - if(!(..())) - return interact(user) + if(..()) + return 1 + if(!allowed(user) && !isobserver(user)) + user << "Access denied." + return 1 + return interact(user) /obj/machinery/spod_part_fabricator/interact(mob/user as mob) var/dat, left_part @@ -457,6 +461,12 @@ if(href_list["remove_mat"] && href_list["material"]) var/amount = text2num(href_list["remove_mat"]) var/material = href_list["material"] + if(href_list["custom_eject"]) + amount = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num + amount = max(0,min(round(resources[material]/MINERAL_MATERIAL_AMOUNT),amount)) // Rounding errors aren't scary, as the mineral eject proc is smart + if (!amount) + return + amount = round(amount) if(amount < 0 || amount > resources[material]) //href protection return diff --git a/code/modules/research/rdconsole.dm b/code/modules/research/rdconsole.dm index 3a14d82bf93..8e6d09403cb 100644 --- a/code/modules/research/rdconsole.dm +++ b/code/modules/research/rdconsole.dm @@ -510,10 +510,11 @@ proc/CallMaterialName(ID) else if(href_list["lathe_ejectsheet"] && linked_lathe) //Causes the protolathe to eject a sheet of material var/desired_num_sheets if (href_list["lathe_ejectsheet_amt"] == "custom") - desired_num_sheets = input("How much?", "How many sheets would you like to eject from the machine?", 1) as null|num + desired_num_sheets = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num desired_num_sheets = max(0,desired_num_sheets) // If you input too high of a number, the mineral datum will take care of it either way if (!desired_num_sheets) return + desired_num_sheets = round(desired_num_sheets) // No partial-sheet goofery else desired_num_sheets = text2num(href_list["lathe_ejectsheet_amt"]) var/MAT @@ -539,10 +540,11 @@ proc/CallMaterialName(ID) else if(href_list["imprinter_ejectsheet"] && linked_imprinter) //Causes the protolathe to eject a sheet of material var/desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"]) if (href_list["imprinter_ejectsheet_amt"] == "custom") - desired_num_sheets = input("How much?", "How many sheets would you like to eject from the machine?", 1) as null|num + desired_num_sheets = input("How many sheets would you like to eject from the machine?", "How much?", 1) as null|num desired_num_sheets = max(0,desired_num_sheets) // for the imprinter they have something hacky, that still will guard against shenanigans. eh if (!desired_num_sheets) return + desired_num_sheets = round(desired_num_sheets) // No partial-sheet goofery else desired_num_sheets = text2num(href_list["imprinter_ejectsheet_amt"]) var/res_amount, type