Fix an exploit

This commit is contained in:
Aronai Sieyes
2020-05-12 14:21:10 -04:00
parent d93b580723
commit 31d69d016d
+2 -2
View File
@@ -238,7 +238,7 @@
count = input("Select the number of pills to make.", "Max [max_pill_count]", pillamount) as null|num
if(!count) //Covers 0 and cancel
return
count = CLAMP(count, 1, max_pill_count)
count = CLAMP(round(count), 1, max_pill_count) // Fix decimals input and clamp to reasonable amounts
if(reagents.total_volume/count < 1) //Sanity checking.
return
@@ -260,7 +260,7 @@
if(reagents.total_volume/count < 1) //Sanity checking.
return
while (count--)
while(count-- > 0) // Will definitely eventually stop.
var/obj/item/weapon/reagent_containers/pill/P = new/obj/item/weapon/reagent_containers/pill(src.loc)
if(!name) name = reagents.get_master_reagent_name()
P.name = "[name] pill"