Skip to content

Commit

Permalink
[MIRROR] Fix ice cream reagent exploit (#2422)
Browse files Browse the repository at this point in the history
Co-authored-by: SierraKomodo <[email protected]>
  • Loading branch information
SierraHelper and SierraKomodo authored Aug 21, 2024
1 parent 603190c commit 8f7b234
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions code/game/machinery/kitchen/icecream.dm
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
var/list/product_types = list()
var/dispense_flavour = ICECREAM_VANILLA
var/flavour_name = "vanilla"
/// `world.time` the next usage can occur. Used to prevent spamming.
var/next_use_time = 0

/obj/machinery/icecream_vat/proc/get_ingredient_list(type)
switch(type)
Expand Down Expand Up @@ -123,6 +125,10 @@
return ..()

/obj/machinery/icecream_vat/proc/make(mob/user, make_type, amount)
amount = clamp(amount, 1, 5)
if (world.time < next_use_time)
USE_FEEDBACK_FAILURE("\The [src] isn't ready yet.")
return
for(var/R in get_ingredient_list(make_type))
if(reagents.has_reagent(R, amount))
continue
Expand All @@ -137,6 +143,7 @@
src.visible_message(SPAN_INFO("[user] cooks up some [flavour] cones."))
else
src.visible_message(SPAN_INFO("[user] whips up some [flavour] icecream."))
next_use_time = world.time + 5 SECONDS
else
to_chat(user, SPAN_WARNING("You don't have the ingredients to make this."))

Expand Down

0 comments on commit 8f7b234

Please sign in to comment.