mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-22 19:47:22 +01:00
Makes Stacks Garbage Collect
This commit is contained in:
@@ -5,7 +5,8 @@
|
||||
icon = 'icons/obj/nanopaste.dmi'
|
||||
icon_state = "tube"
|
||||
origin_tech = "materials=2;engineering=3"
|
||||
amount = 10
|
||||
amount = 6
|
||||
max_amount = 6
|
||||
toolspeed = 1
|
||||
|
||||
/obj/item/stack/nanopaste/attack(mob/living/M as mob, mob/user as mob)
|
||||
|
||||
@@ -26,8 +26,7 @@
|
||||
/obj/item/stack/Destroy()
|
||||
if(usr && usr.machine == src)
|
||||
usr << browse(null, "window=stack")
|
||||
..()
|
||||
return QDEL_HINT_HARDDEL_NOW // because qdel'd stacks act strange for cyborgs
|
||||
return ..()
|
||||
|
||||
/obj/item/stack/examine(mob/user)
|
||||
if(..(user, 1))
|
||||
@@ -195,15 +194,18 @@
|
||||
interact(usr)
|
||||
return
|
||||
|
||||
/obj/item/stack/proc/use(var/used)
|
||||
/obj/item/stack/proc/use(used)
|
||||
if(amount < used)
|
||||
return 0
|
||||
amount -= used
|
||||
if(amount < 1) // Just in case a stack's amount ends up fractional somehow
|
||||
if(isrobot(loc))
|
||||
var/mob/living/silicon/robot/R = loc //Horrifying cyborg snowflake code that allows stacks to GC and cyborgs not to horrendously break
|
||||
if(locate(src) in R.module.modules)
|
||||
R.module.modules -= src
|
||||
if(usr)
|
||||
usr.unEquip(src, 1)
|
||||
spawn()
|
||||
qdel(src)
|
||||
usr.unEquip(src, TRUE) // this has to be unEquip() over drop_item() or something similar because of cyborgs
|
||||
qdel(src)
|
||||
update_icon()
|
||||
return 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user