mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-23 21:27:01 +01:00
Fix items attempting to directly access/touch amount on stack var.
PR https://github.com/VOREStation/VOREStation/pull/11454 set var amount on stacks to private, necessitating using get_amount() to read the amount currently left in a stack, rather than just directly accessing the var.
This commit is contained in:
@@ -67,8 +67,7 @@
|
||||
if(default_deconstruction_screwdriver(user, W))
|
||||
if(do_after(user, 15))
|
||||
to_chat(user, "You deconstruct the feeder.")
|
||||
var/obj/item/stack/material/plastic/A = new /obj/item/stack/material/plastic(src.loc)
|
||||
A.amount = 4
|
||||
new /obj/item/stack/material/plastic(src.loc, 4)
|
||||
if(beaker)
|
||||
beaker.loc = get_turf(src)
|
||||
beaker = null
|
||||
|
||||
@@ -25,12 +25,12 @@
|
||||
var/hasRecord = FALSE //Check to see if this passes or not.
|
||||
for(var/datum/stored_item/I in item_records)
|
||||
if((O.type == I.item_path) && (O.name == I.item_name))
|
||||
mod_amount(I,O.amount)
|
||||
mod_amount(I,O.get_amount())
|
||||
hasRecord = TRUE
|
||||
qdel(O)
|
||||
break
|
||||
if(!hasRecord)
|
||||
var/datum/stored_item/item = new/datum/stored_item(src,O.type,O.name,O.amount)
|
||||
var/datum/stored_item/item = new/datum/stored_item(src,O.type,O.name,O.get_amount())
|
||||
item_records.Add(item)
|
||||
qdel(O)
|
||||
|
||||
|
||||
@@ -142,8 +142,7 @@
|
||||
holder.icon_state = "scarab_wire2"
|
||||
else
|
||||
user.visible_message("[user] removes the wiring from [holder].", "You remove the wiring from [holder].")
|
||||
var/obj/item/stack/cable_coil/coil = new /obj/item/stack/cable_coil(get_turf(holder))
|
||||
coil.amount = 4
|
||||
new /obj/item/stack/cable_coil(get_turf(holder), 4)
|
||||
holder.icon_state = "scarab_chassis_complete"
|
||||
if(16)
|
||||
if(diff==FORWARD)
|
||||
@@ -238,8 +237,7 @@
|
||||
holder.icon_state = "scarab_chip5"
|
||||
else
|
||||
user.visible_message("[user] pries internal armor layer from [holder].", "You prie internal armor layer from [holder].")
|
||||
var/obj/item/stack/material/steel/MS = new /obj/item/stack/material/steel(get_turf(holder))
|
||||
MS.amount = 5
|
||||
new /obj/item/stack/material/steel(get_turf(holder), 5)
|
||||
holder.icon_state = "scarab_chip5"
|
||||
if(4)
|
||||
if(diff==FORWARD)
|
||||
@@ -261,8 +259,7 @@
|
||||
holder.icon_state = "scarab_weld2"
|
||||
else
|
||||
user.visible_message("[user] pries the external armor layer from [holder].", "You pry external armor layer from [holder].")
|
||||
var/obj/item/stack/material/plasteel/MS = new /obj/item/stack/material/plasteel(get_turf(holder))
|
||||
MS.amount = 5
|
||||
new /obj/item/stack/material/plasteel(get_turf(holder), 5)
|
||||
holder.icon_state = "scarab_weld1"
|
||||
if(1)
|
||||
if(diff==FORWARD)
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
..()
|
||||
var/obj/item/stack/material/lead/M = I
|
||||
if(istype(M))
|
||||
if(M.amount>5)
|
||||
if(M.get_amount() > 5)
|
||||
to_chat(user,"<span class='notice'>You add a lead shell to the blitz rod.</span>")
|
||||
qdel(src)
|
||||
var/obj/item/weapon/fuel_assembly/blitz/shielded/rod = new(get_turf(user))
|
||||
|
||||
Reference in New Issue
Block a user