Skip to content

Commit

Permalink
fix own bug that prevented the recyling vendor from accepting items (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
du-top authored Dec 16, 2023
1 parent b2e1b2b commit 8fbbb74
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions code/game/machinery/vendor/recycle_vendor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -162,18 +162,16 @@
if(i in materials_supported)
if(i in materials_allowed)
var/material/M = get_material_by_name(i)
var/obj/item/stack/material/temp_stack = stored_item_object

if (temp_stack)
if (istype(stored_item_object, /obj/item/stack))
var/obj/item/stack/temp_stack = stored_item_object
var/obj/item/stack/material/S = new M.stack_type(null, stored_item_materials[i] * temp_stack.amount)
stored_item_value += S.get_item_cost()
stored_item_fluff += "<br>[i] - [stored_item_materials[i] * temp_stack.amount] units, worth [S.get_item_cost()] credits."
else
var/obj/item/stack/material/S = new M.stack_type(null, stored_item_materials[i])
stored_item_value += S.get_item_cost()
stored_item_fluff += "<br>[i] - [stored_item_materials[i]] units, worth [S.get_item_cost()] credits."


else
stored_item_fluff += "<br>Payouts for [i] suspended by LSS representative."
else // Bay leftover materials
Expand All @@ -197,8 +195,8 @@
T.apply_to(merchants_pocket)

for(var/i in stored_item_materials)
var/obj/item/stack/material/temp_stack = stored_item_object
if (temp_stack)
if (istype(stored_item_object, /obj/item/stack))
var/obj/item/stack/temp_stack = stored_item_object
if(i in materials_stored)
materials_stored[i] += stored_item_materials[i] * temp_stack.amount
else
Expand Down

0 comments on commit 8fbbb74

Please sign in to comment.