Merge pull request #33805 from Cruix/shuttle_machines
Fixed autolathes and ore redemption machines leaving things at previous shuttle locations
This commit is contained in:
committed by
CitadelStationBot
parent
eda5869b4f
commit
3802cf8586
@@ -149,8 +149,6 @@
|
||||
|
||||
if(href_list["make"])
|
||||
|
||||
var/turf/T = loc
|
||||
|
||||
/////////////////
|
||||
//href protection
|
||||
being_built = stored_research.isDesignResearchedID(href_list["make"])
|
||||
@@ -174,34 +172,8 @@
|
||||
use_power(power)
|
||||
icon_state = "autolathe"
|
||||
flick("autolathe_n",src)
|
||||
if(is_stack)
|
||||
spawn(32*coeff)
|
||||
use_power(power)
|
||||
var/list/materials_used = list(MAT_METAL=metal_cost*multiplier, MAT_GLASS=glass_cost*multiplier)
|
||||
materials.use_amount(materials_used)
|
||||
|
||||
var/obj/item/stack/N = new being_built.build_path(T, multiplier)
|
||||
N.update_icon()
|
||||
N.autolathe_crafted(src)
|
||||
|
||||
for(var/obj/item/stack/S in T.contents - N)
|
||||
if(istype(S, N.merge_type))
|
||||
N.merge(S)
|
||||
busy = FALSE
|
||||
updateUsrDialog()
|
||||
|
||||
else
|
||||
spawn(32*coeff*multiplier)
|
||||
use_power(power)
|
||||
var/list/materials_used = list(MAT_METAL=metal_cost*coeff*multiplier, MAT_GLASS=glass_cost*coeff*multiplier)
|
||||
materials.use_amount(materials_used)
|
||||
for(var/i=1, i<=multiplier, i++)
|
||||
var/obj/item/new_item = new being_built.build_path(T)
|
||||
for(var/mat in materials_used)
|
||||
new_item.materials[mat] = materials_used[mat] / multiplier
|
||||
new_item.autolathe_crafted(src)
|
||||
busy = FALSE
|
||||
updateUsrDialog()
|
||||
var/time = is_stack ? 32 : 32*coeff*multiplier
|
||||
addtimer(CALLBACK(src, .proc/make_item, power, metal_cost, glass_cost, multiplier, coeff, is_stack), time)
|
||||
|
||||
if(href_list["search"])
|
||||
matching_designs.Cut()
|
||||
@@ -218,6 +190,30 @@
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/autolathe/proc/make_item(power, metal_cost, glass_cost, multiplier, coeff, is_stack)
|
||||
GET_COMPONENT(materials, /datum/component/material_container)
|
||||
var/atom/A = drop_location()
|
||||
use_power(power)
|
||||
var/list/materials_used = list(MAT_METAL=metal_cost*coeff*multiplier, MAT_GLASS=glass_cost*coeff*multiplier)
|
||||
materials.use_amount(materials_used)
|
||||
|
||||
if(is_stack)
|
||||
var/obj/item/stack/N = new being_built.build_path(A, multiplier)
|
||||
N.update_icon()
|
||||
N.autolathe_crafted(src)
|
||||
for(var/obj/item/stack/S in (A.contents - N))
|
||||
if(istype(S, N.merge_type))
|
||||
N.merge(S)
|
||||
else
|
||||
for(var/i=1, i<=multiplier, i++)
|
||||
var/obj/item/new_item = new being_built.build_path(A)
|
||||
for(var/mat in materials_used)
|
||||
new_item.materials[mat] = materials_used[mat] / multiplier
|
||||
new_item.autolathe_crafted(src)
|
||||
|
||||
busy = FALSE
|
||||
updateDialog()
|
||||
|
||||
/obj/machinery/autolathe/RefreshParts()
|
||||
var/T = 0
|
||||
for(var/obj/item/stock_parts/matter_bin/MB in component_parts)
|
||||
|
||||
Reference in New Issue
Block a user