mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 02:09:41 +00:00
Fixes autolathe, material and smartfridge issues
This commit is contained in:
committed by
CHOMPStation2
parent
a2dabe62a1
commit
165d947e91
@@ -104,7 +104,7 @@
|
||||
|
||||
if(shocked)
|
||||
shock(user, 50)
|
||||
|
||||
|
||||
tgui_interact(user)
|
||||
|
||||
/obj/machinery/autolathe/attackby(var/obj/item/O as obj, var/mob/user as mob)
|
||||
@@ -135,7 +135,7 @@
|
||||
if(istype(O,/obj/item/ammo_magazine/clip) || istype(O,/obj/item/ammo_magazine/s357) || istype(O,/obj/item/ammo_magazine/s38) || istype (O,/obj/item/ammo_magazine/s44)/* VOREstation Edit*/) // Prevents ammo recycling exploit with speedloaders.
|
||||
to_chat(user, "\The [O] is too hazardous to recycle with the autolathe!")
|
||||
return
|
||||
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/autolathe/attack_hand(mob/user as mob)
|
||||
@@ -177,12 +177,12 @@
|
||||
max_sheets = 0
|
||||
//Build list of multipliers for sheets.
|
||||
multiplier = tgui_input_number(usr, "How many do you want to print? (0-[max_sheets])", null, null, max_sheets, 0)
|
||||
if(!multiplier || multiplier <= 0 || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
if(!multiplier || multiplier <= 0 || (multiplier != round(multiplier)) || multiplier > max_sheets || tgui_status(usr, state) != STATUS_INTERACTIVE)
|
||||
return FALSE
|
||||
|
||||
//Check if we still have the materials.
|
||||
var/coeff = (making.no_scale ? 1 : mat_efficiency) //stacks are unaffected by production coefficient
|
||||
|
||||
|
||||
for(var/datum/material/used_material as anything in making.resources)
|
||||
var/amount_needed = making.resources[used_material] * coeff * multiplier
|
||||
materials_used[used_material] = amount_needed
|
||||
@@ -190,7 +190,7 @@
|
||||
if(LAZYLEN(materials_used))
|
||||
if(!materials.has_materials(materials_used))
|
||||
return
|
||||
|
||||
|
||||
materials.use_materials(materials_used)
|
||||
|
||||
busy = making.name
|
||||
|
||||
Reference in New Issue
Block a user