mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 20:16:55 +01:00
Fixes waterpacks and friends not GCing (#19269)
Move nozzles to Initialize Makes reagents not hold a reference to their atom when they get destroyed
This commit is contained in:
@@ -45,10 +45,11 @@
|
||||
. += "<span class='notice'>The safety is [safety ? "on" : "off"].</span>"
|
||||
|
||||
|
||||
/obj/item/extinguisher/New()
|
||||
..()
|
||||
create_reagents(max_water)
|
||||
reagents.add_reagent("water", max_water)
|
||||
/obj/item/extinguisher/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!reagents)
|
||||
create_reagents(max_water)
|
||||
reagents.add_reagent("water", max_water)
|
||||
|
||||
/obj/item/extinguisher/attack_self(mob/user as mob)
|
||||
safety = !safety
|
||||
|
||||
@@ -128,16 +128,16 @@
|
||||
|
||||
var/obj/item/watertank/tank
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/New(parent_tank)
|
||||
..()
|
||||
if(check_tank_exists(parent_tank, src))
|
||||
tank = parent_tank
|
||||
reagents = tank.reagents //This mister is really just a proxy for the tank's reagents
|
||||
loc = tank
|
||||
return
|
||||
/obj/item/reagent_containers/spray/mister/Initialize(mapload)
|
||||
if(!check_tank_exists(loc, src))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
tank = loc
|
||||
reagents = tank.reagents //This mister is really just a proxy for the tank's reagents
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/Destroy()
|
||||
tank = null
|
||||
reagents = null // Unset, this is the tanks reagents
|
||||
return ..()
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/dropped(mob/user as mob)
|
||||
@@ -151,11 +151,9 @@
|
||||
|
||||
/proc/check_tank_exists(parent_tank, mob/living/carbon/human/M, obj/O)
|
||||
if(!parent_tank || !istype(parent_tank, /obj/item/watertank)) //To avoid weird issues from admin spawns
|
||||
M.unEquip(O)
|
||||
qdel(0)
|
||||
return 0
|
||||
return FALSE
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/item/reagent_containers/spray/mister/Move()
|
||||
..()
|
||||
@@ -239,14 +237,20 @@
|
||||
var/metal_synthesis_cooldown = 0
|
||||
var/nanofrost_cooldown = 0
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/New(parent_tank)
|
||||
. = ..()
|
||||
if(check_tank_exists(parent_tank, src))
|
||||
tank = parent_tank
|
||||
reagents = tank.reagents
|
||||
max_water = tank.volume
|
||||
loc = tank
|
||||
return
|
||||
/obj/item/extinguisher/mini/nozzle/Initialize(mapload)
|
||||
if(!check_tank_exists(loc, src))
|
||||
return INITIALIZE_HINT_QDEL
|
||||
|
||||
tank = loc
|
||||
reagents = tank.reagents
|
||||
max_water = tank.volume
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/Destroy()
|
||||
tank = null
|
||||
reagents = null // Unset, this is the tanks reagents
|
||||
return ..()
|
||||
|
||||
/obj/item/extinguisher/mini/nozzle/Move()
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user