Merge pull request #7809 from VOREStation/aro-fix1

Fix an exploit
This commit is contained in:
Leshana
2020-05-12 14:35:57 -04:00
committed by GitHub

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"