diff --git a/code/__DEFINES/dcs/signals.dm b/code/__DEFINES/dcs/signals.dm
index a3da9670e78..37436d79c1a 100644
--- a/code/__DEFINES/dcs/signals.dm
+++ b/code/__DEFINES/dcs/signals.dm
@@ -207,6 +207,8 @@
#define ZIMPACT_NO_MESSAGE (1<<1)
/// Do not do the spin animation when landing
#define ZIMPACT_NO_SPIN (1<<2)
+///called when the movable sucessfully has it's density var changed, from base atom/set_density(): (value)
+#define COMSIG_ATOM_SET_DENSITY "atom_set_density"
/////////////////
///from base of area/Entered(): (/area)
diff --git a/code/__HELPERS/path.dm b/code/__HELPERS/path.dm
index c75c5f9eb3c..c76794fe3f4 100644
--- a/code/__HELPERS/path.dm
+++ b/code/__HELPERS/path.dm
@@ -465,7 +465,7 @@
if(!length(path_turfs))
return TRUE
var/obj/dummy = new(start_turf)
- dummy.density = TRUE
+ dummy.set_density(TRUE)
if(flags)
dummy.pass_flags |= flags
for(var/turf/turf as anything in path_turfs)
diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm
index d086899ec63..675d55cca50 100644
--- a/code/__HELPERS/unsorted.dm
+++ b/code/__HELPERS/unsorted.dm
@@ -643,7 +643,7 @@ Returns 1 if the chain up to the area contains the given typepath
// Spawn a new shuttle corner object
var/obj/corner = new()
corner.loc = X
- corner.density = 1
+ corner.set_density(TRUE)
corner.set_anchored(TRUE)
corner.icon = X.icon
corner.icon_state = replacetext(X.icon_state, "_s", "_f")
diff --git a/code/datums/spell.dm b/code/datums/spell.dm
index 7387b3c9b22..3a320a307d9 100644
--- a/code/datums/spell.dm
+++ b/code/datums/spell.dm
@@ -489,7 +489,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell))
spell.icon = overlay_icon
spell.icon_state = overlay_icon_state
spell.set_anchored(TRUE)
- spell.density = FALSE
+ spell.set_density(FALSE)
spawn(overlay_lifespan)
qdel(spell)
diff --git a/code/datums/spells/projectile.dm b/code/datums/spells/projectile.dm
index 2d57909b49c..16d47f9d8aa 100644
--- a/code/datums/spells/projectile.dm
+++ b/code/datums/spells/projectile.dm
@@ -78,7 +78,7 @@
var/obj/effect/overlay/trail = new /obj/effect/overlay(projectile.loc)
trail.icon = proj_trail_icon
trail.icon_state = proj_trail_icon_state
- trail.density = FALSE
+ trail.set_density(FALSE)
spawn(proj_trail_lifespan)
qdel(trail)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index 141e4e5c6f6..dc49d57bcb2 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -1337,17 +1337,20 @@ GLOBAL_LIST_EMPTY(blood_splatter_icons)
return t
-/*
- Setter for the `density` variable.
- Arguments:
- * new_value - the new density you would want it to set.
- Returns: Either null if identical to existing density, or the new density if different.
-*/
+/**
+ * Setter for the `density` variable.
+ * Returns: Either null if identical to existing density, or the new density if different.
+ *
+ * Arguments:
+ * * new_value - the new density you would want it to set.
+ **/
/atom/proc/set_density(new_value)
+ SHOULD_CALL_PARENT(TRUE)
if(density == new_value)
return
. = density
density = new_value
+ SEND_SIGNAL(src, COMSIG_ATOM_SET_DENSITY, new_value)
// Процедура выбора правильного падежа для любого предмета,если у него указан словарь «ru_names», примерно такой:
// ru_names = list(NOMINATIVE = "челюсти жизни", GENITIVE = "челюстей жизни", DATIVE = "челюстям жизни", ACCUSATIVE = "челюсти жизни", INSTRUMENTAL = "челюстями жизни", PREPOSITIONAL = "челюстях жизни")
diff --git a/code/game/gamemodes/blob/theblob.dm b/code/game/gamemodes/blob/theblob.dm
index 6200087079a..c37e1b96dd1 100644
--- a/code/game/gamemodes/blob/theblob.dm
+++ b/code/game/gamemodes/blob/theblob.dm
@@ -142,9 +142,9 @@
return
var/obj/structure/blob/normal/B = new /obj/structure/blob/normal(src.loc, min(obj_integrity, 30))
B.color = a_color
- B.density = 1
+ B.set_density(TRUE)
if(T.Enter(B,src))//Attempt to move into the tile
- B.density = initial(B.density)
+ B.set_density(initial(B.density))
B.loc = T
else
T.blob_act()//If we cant move in hit the turf
diff --git a/code/game/gamemodes/cult/cult_structures.dm b/code/game/gamemodes/cult/cult_structures.dm
index ce1076d2755..d564ff7f4d6 100644
--- a/code/game/gamemodes/cult/cult_structures.dm
+++ b/code/game/gamemodes/cult/cult_structures.dm
@@ -125,7 +125,7 @@
return message
/obj/structure/cult/functional/cult_conceal()
- density = FALSE
+ set_density(FALSE)
visible_message("[src] fades away.")
invisibility = INVISIBILITY_HIDDEN_RUNES
alpha = 100 //To help ghosts distinguish hidden objs
@@ -134,7 +134,7 @@
update_light()
/obj/structure/cult/functional/cult_reveal()
- density = initial(density)
+ set_density(initial(density))
invisibility = 0
visible_message("[src] suddenly appears!")
alpha = initial(alpha)
diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm
index 78eecdcdef0..0e30b7975e1 100644
--- a/code/game/machinery/deployable.dm
+++ b/code/game/machinery/deployable.dm
@@ -149,7 +149,7 @@
/obj/structure/barricade/security/proc/deploy()
icon_state = "barrier1"
- density = TRUE
+ set_density(TRUE)
set_anchored(TRUE)
if(deploy_message)
visible_message(span_warning("[src] deploys!"))
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 3ee9239214e..3d027013173 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1292,7 +1292,7 @@ About the new airlock wires panel:
set_opacity(FALSE)
update_freelook_sight()
sleep(4)
- density = FALSE
+ set_density(FALSE)
air_update_turf(TRUE)
sleep(1)
layer = OPEN_DOOR_LAYER
@@ -1331,7 +1331,7 @@ About the new airlock wires panel:
layer = CLOSED_DOOR_LAYER
if(!override)
sleep(1)
- density = TRUE
+ set_density(TRUE)
air_update_turf(TRUE)
if(!override)
sleep(4)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index cf9601444ed..346a3621a7a 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -87,7 +87,7 @@
..()
/obj/machinery/door/Destroy()
- density = 0
+ set_density(FALSE)
air_update_turf(1)
update_freelook_sight()
GLOB.airlocks -= src
@@ -404,7 +404,7 @@
do_animate("opening")
set_opacity(FALSE)
sleep(0.5 SECONDS)
- density = FALSE
+ set_density(FALSE)
sleep(0.5 SECONDS)
layer = initial(layer)
update_icon()
@@ -434,7 +434,7 @@
do_animate("closing")
layer = closingLayer
sleep(0.5 SECONDS)
- density = TRUE
+ set_density(TRUE)
sleep(0.5 SECONDS)
update_icon()
if(visible && !glass)
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 78d18e867b6..745437fb4e2 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -41,7 +41,7 @@
debris += new /obj/item/stack/cable_coil(src, cable)
/obj/machinery/door/window/Destroy()
- density = FALSE
+ set_density(FALSE)
QDEL_LIST(debris)
if(obj_integrity == 0)
playsound(src, "shatter", 70, 1)
@@ -171,7 +171,7 @@
update_icon()
sleep(1 SECONDS)
- density = FALSE
+ set_density(FALSE)
air_update_turf(TRUE)
update_freelook_sight()
@@ -192,7 +192,7 @@
do_animate("closing")
playsound(loc, 'sound/machines/windowdoor.ogg', 100, TRUE)
- density = TRUE
+ set_density(TRUE)
update_icon()
air_update_turf(TRUE)
update_freelook_sight()
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index ed90efc5d8e..574664b4f94 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -75,10 +75,10 @@
/obj/machinery/mass_driver/bumper/Bumped(atom/movable/moving_atom)
..()
- density = 0
+ set_density(FALSE)
step(moving_atom, get_dir(moving_atom, src))
spawn(1)
- density = 1
+ set_density(TRUE)
drive()
return
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 2fa45d707d7..a816a708d1c 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -183,4 +183,4 @@
var/p_type = text2num(href_list["dmake"])
var/obj/structure/disposalconstruct/C = new(loc, p_type)
if(p_type in list(PIPE_DISPOSALS_BIN, PIPE_DISPOSALS_OUTLET, PIPE_DISPOSALS_CHUTE))
- C.density = TRUE
+ C.set_density(TRUE)
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 203a4f4021e..3df1a606b2d 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -675,7 +675,7 @@ GLOBAL_LIST_EMPTY(turret_icons)
/obj/machinery/porta_turret/proc/set_raised_raising(var/is_raised, var/is_raising)
raised = is_raised
raising = is_raising
- density = is_raised || is_raising
+ set_density(is_raised || is_raising)
/obj/machinery/porta_turret/proc/target(mob/living/target)
if(disabled)
diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm
index b5ef1d595ee..b3ffc81f37c 100644
--- a/code/game/machinery/shieldgen.dm
+++ b/code/game/machinery/shieldgen.dm
@@ -19,7 +19,7 @@
/obj/machinery/shield/Destroy()
opacity = FALSE
- density = 0
+ set_density(FALSE)
air_update_turf(1)
return ..()
@@ -110,18 +110,16 @@
* The barrier itself is not intended to interact with the conceal runes cult spell for balance purposes.
*/
/obj/machinery/shield/cult/barrier/proc/Toggle()
- var/visible
- if(!density) // Currently invisible
- density = TRUE // Turn visible
+ set_density(!density)
+ if(density)
invisibility = initial(invisibility)
- visible = TRUE
- else // Currently visible
- density = FALSE // Turn invisible
+ . = TRUE
+ else
invisibility = INVISIBILITY_ABSTRACT
- visible = FALSE
+ . = FALSE
air_update_turf(1)
- return visible
+ return .
/obj/machinery/shieldgen
name = "Emergency shield projector"
diff --git a/code/game/mecha/mecha_construction_paths.dm b/code/game/mecha/mecha_construction_paths.dm
index 77f8806431e..248b3979288 100644
--- a/code/game/mecha/mecha_construction_paths.dm
+++ b/code/game/mecha/mecha_construction_paths.dm
@@ -71,7 +71,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/ripley(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "ripley0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
const_holder.overlays = null
qdel(src)
return
@@ -273,7 +273,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/gygax(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "gygax0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -546,7 +546,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/firefighter(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "fireripley0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -759,7 +759,7 @@
..("Honker")
var/obj/item/mecha_parts/chassis/const_holder = holder
const_holder.construct = new /datum/construction/reversible/mecha/honker(const_holder)
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -831,7 +831,7 @@
..("Reticence")
var/obj/item/mecha_parts/chassis/const_holder = holder
const_holder.construct = new /datum/construction/reversible/mecha/reticence(const_holder)
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -907,7 +907,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/durand(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "durand0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -1183,7 +1183,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/phazon(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "phazon0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -1500,7 +1500,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/odysseus(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "odysseus0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -1705,7 +1705,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/clarke(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "clarke0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -1908,7 +1908,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/rover(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "rover0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
@@ -2182,7 +2182,7 @@
const_holder.construct = new /datum/construction/reversible/mecha/darkgygax(const_holder)
const_holder.icon = 'icons/obj/mecha/mech_construction.dmi'
const_holder.icon_state = "darkgygax0"
- const_holder.density = 1
+ const_holder.set_density(TRUE)
qdel(src)
return
diff --git a/code/game/objects/items/bodybag.dm b/code/game/objects/items/bodybag.dm
index 7ae780c028d..c985155fd66 100644
--- a/code/game/objects/items/bodybag.dm
+++ b/code/game/objects/items/bodybag.dm
@@ -45,10 +45,9 @@
/obj/structure/closet/body_bag/close()
- if(..())
- density = FALSE
- return TRUE
- return FALSE
+ . = ..()
+ if(.)
+ set_density(FALSE)
/obj/structure/closet/body_bag/update_icon_state()
diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm
index afc1f51d5ef..1d760f263ae 100644
--- a/code/game/objects/items/devices/powersink.dm
+++ b/code/game/objects/items/devices/powersink.dm
@@ -42,7 +42,7 @@
if(mode == OPERATING)
STOP_PROCESSING(SSobj, src)
set_anchored(FALSE)
- density = FALSE
+ set_density(FALSE)
if(CLAMPED_OFF)
if(!attached)
@@ -50,14 +50,14 @@
if(mode == OPERATING)
STOP_PROCESSING(SSobj, src)
set_anchored(TRUE)
- density = TRUE
+ set_density(TRUE)
if(OPERATING)
if(!attached)
return
START_PROCESSING(SSobj, src)
set_anchored(TRUE)
- density = TRUE
+ set_density(TRUE)
mode = value
update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/objects/items/shooting_range.dm b/code/game/objects/items/shooting_range.dm
index 4a7ab9f0e3a..2ef20284537 100644
--- a/code/game/objects/items/shooting_range.dm
+++ b/code/game/objects/items/shooting_range.dm
@@ -13,7 +13,7 @@
for(var/obj/structure/target_stake/T in view(3, src))
if(T.pinned_target == src)
T.pinned_target = null
- T.density = TRUE
+ T.set_density(TRUE)
break
return ..() // delete target
@@ -21,7 +21,7 @@
. = ..()
// After target moves, check for nearby stakes. If associated, move to target
for(var/obj/structure/target_stake/M in view(3, src))
- if(M.density == 0 && M.pinned_target == src)
+ if(!M.density && M.pinned_target == src)
M.loc = loc
// This may seem a little counter-intuitive but I assure you that's for a purpose.
@@ -49,8 +49,8 @@
if(stake)
if(stake.pinned_target)
- stake.density = TRUE
- density = FALSE
+ stake.set_density(TRUE)
+ set_density(FALSE)
layer = OBJ_LAYER
loc = user.loc
diff --git a/code/game/objects/items/weapons/anomaly_extract.dm b/code/game/objects/items/weapons/anomaly_extract.dm
index 1ad55fc89e6..4233b1b791f 100644
--- a/code/game/objects/items/weapons/anomaly_extract.dm
+++ b/code/game/objects/items/weapons/anomaly_extract.dm
@@ -147,7 +147,7 @@
cooldown_handler.recharge_duration = COOLDOWN_TO_SLIME_MOB
cooldown_handler.start_recharge()
playsound(get_turf(usr), sound, 50, TRUE)
- user.density = FALSE
+ user.set_density(FALSE)
original_body.notransform = TRUE
original_body.dir = SOUTH
original_body.forceMove(get_turf(user))
diff --git a/code/game/objects/structures/aliens.dm b/code/game/objects/structures/aliens.dm
index 41f57046675..ea780f25e96 100644
--- a/code/game/objects/structures/aliens.dm
+++ b/code/game/objects/structures/aliens.dm
@@ -143,7 +143,7 @@
/obj/structure/alien/resin/door/Destroy()
- density = FALSE
+ set_density(FALSE)
update_freelook_sight()
return ..()
@@ -236,7 +236,7 @@
update_freelook_sight()
sleep(0.4 SECONDS)
- density = FALSE
+ set_density(FALSE)
air_update_turf(TRUE)
sleep(0.1 SECONDS)
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index eff223c85ca..786245d2540 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -121,7 +121,7 @@ GLOBAL_LIST_EMPTY(closets)
playsound(loc, open_sound, open_sound_volume, TRUE, -3)
else
playsound(loc, 'sound/machines/click.ogg', open_sound_volume, TRUE, -3)
- density = FALSE
+ set_density(FALSE)
after_open()
return TRUE
@@ -172,7 +172,7 @@ GLOBAL_LIST_EMPTY(closets)
playsound(loc, close_sound, close_sound_volume, TRUE, -3)
else
playsound(loc, 'sound/machines/click.ogg', close_sound_volume, TRUE, -3)
- density = ignore_density_closed ? FALSE : TRUE
+ set_density(!ignore_density_closed)
return TRUE
/obj/structure/closet/proc/toggle(mob/user)
@@ -520,4 +520,4 @@ GLOBAL_LIST_EMPTY(closets)
/obj/structure/closet/bluespace/close()
. = ..()
- density = 0
+ set_density(FALSE)
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index 9c126a399a6..fe3084b4519 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -61,7 +61,7 @@
qdel(src)
/obj/structure/falsewall/Destroy()
- density = 0
+ set_density(FALSE)
air_update_turf(1)
return ..()
@@ -85,7 +85,7 @@
add_fingerprint(user)
do_the_flick()
sleep(0.4 SECONDS)
- density = FALSE
+ set_density(FALSE)
obj_flags &= ~BLOCK_Z_IN_DOWN
set_opacity(FALSE)
else
@@ -95,7 +95,7 @@
return
add_fingerprint(user)
do_the_flick()
- density = TRUE
+ set_density(TRUE)
obj_flags |= BLOCK_Z_IN_DOWN
sleep(0.4 SECONDS)
set_opacity(TRUE)
diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm
index 73d93eaef32..79b8c71b9c9 100644
--- a/code/game/objects/structures/flora.dm
+++ b/code/game/objects/structures/flora.dm
@@ -425,7 +425,7 @@
icon_state = "stump[rand(1,2)]"
name = "cleared foliage"
desc = "There used to be dense undergrowth here."
- density = 0
+ set_density(FALSE)
stump = 1
pixel_x = rand(-6,6)
pixel_y = rand(-6,6)
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index d72f8a58d5e..2c110abd1e2 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -158,7 +158,7 @@
return
state_closed = !state_closed
- density = state_closed
+ set_density(state_closed)
set_opacity(state_closed)
update_icon(UPDATE_ICON_STATE)
air_update_turf(TRUE)
diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm
index a3f03ca3865..f0901c59cc2 100644
--- a/code/game/objects/structures/mineral_doors.dm
+++ b/code/game/objects/structures/mineral_doors.dm
@@ -27,7 +27,7 @@
air_update_turf(1)
/obj/structure/mineral_door/Destroy()
- density = 0
+ set_density(FALSE)
air_update_turf(1)
return ..()
@@ -96,8 +96,8 @@
playsound(loc, openSound, 100, 1)
flick("[initial_state]opening",src)
sleep(10)
- density = 0
- opacity = 0
+ set_density(FALSE)
+ set_opacity(FALSE)
state = 1
air_update_turf(1)
update_icon(UPDATE_ICON_STATE)
@@ -117,8 +117,8 @@
playsound(loc, closeSound, 100, 1)
flick("[initial_state]closing",src)
sleep(10)
- density = 1
- opacity = 1
+ set_density(TRUE)
+ set_opacity(TRUE)
state = 0
air_update_turf(1)
update_icon(UPDATE_ICON_STATE)
diff --git a/code/game/objects/structures/stool_bed_chair_nest/bed.dm b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
index cb646cfe284..079b56c81bd 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/bed.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/bed.dm
@@ -110,13 +110,13 @@
/obj/structure/bed/roller/post_buckle_mob(mob/living/M)
. = ..()
- density = TRUE
+ set_density(TRUE)
icon_state = icon_up
M.pixel_y = initial(M.pixel_y)
/obj/structure/bed/roller/post_unbuckle_mob(mob/living/M)
. = ..()
- density = FALSE
+ set_density(FALSE)
icon_state = icon_down
M.pixel_x = M.get_standard_pixel_x_offset(M.lying_angle)
M.pixel_y = M.get_standard_pixel_y_offset(M.lying_angle)
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 07f552f1dc2..5521ed3b394 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -917,7 +917,7 @@
/obj/structure/rack/gunrack/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
- density = FALSE
+ set_density(FALSE)
var/obj/item/gunrack_parts/newparts = new(loc)
transfer_fingerprints_to(newparts)
for(var/obj/item/I in loc.contents)
@@ -963,7 +963,7 @@
/obj/structure/rack/deconstruct(disassembled = TRUE)
if(!(flags & NODECONSTRUCT))
- density = FALSE
+ set_density(FALSE)
var/obj/item/rack_parts/newparts = new(loc)
transfer_fingerprints_to(newparts)
qdel(src)
diff --git a/code/game/objects/structures/target_stake.dm b/code/game/objects/structures/target_stake.dm
index 76ccdb6365a..97f53dd7137 100644
--- a/code/game/objects/structures/target_stake.dm
+++ b/code/game/objects/structures/target_stake.dm
@@ -20,14 +20,14 @@
else // Sanity check: if the pinned target can't be found in immediate view
pinned_target = null
- density = 1
+ set_density(TRUE)
/obj/structure/target_stake/attackby(obj/item/W, mob/user, params)
// Putting objects on the stake. Most importantly, targets
if(istype(W, /obj/item/target) && !pinned_target)
add_fingerprint(user)
- density = 0
- W.density = 1
+ set_density(FALSE)
+ W.set_density(TRUE)
user.drop_from_active_hand(src)
W.loc = loc
W.layer = 3.1
@@ -40,8 +40,8 @@
// taking pinned targets off!
if(pinned_target)
add_fingerprint(user)
- density = 1
- pinned_target.density = 0
+ set_density(TRUE)
+ pinned_target.set_density(FALSE)
pinned_target.layer = OBJ_LAYER
pinned_target.loc = user.loc
diff --git a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
index bd368eb24f9..2eac959ffcc 100644
--- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
+++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm
@@ -104,7 +104,7 @@
if(!next_dir)
moving = FALSE
- density = TRUE
+ set_density(TRUE)
return
exit_delay = current_tube.exit_delay
next_loc = get_step(src, next_dir)
@@ -118,7 +118,7 @@
setDir(next_dir)
Move(get_step(loc, dir), dir) // Allow collisions when leaving the tubes.
moving = FALSE
- density = TRUE
+ set_density(TRUE)
return
enter_delay = current_tube.enter_delay(src, next_dir)
@@ -131,7 +131,7 @@
if(stage == MOVE_ANIMATION_STAGE_TWO)
setDir(next_dir)
forceMove(next_loc) // When moving from one tube to another, skip collision and such.
- density = current_tube.density
+ set_density(current_tube.density)
if(current_tube?.should_stop_pod(src, next_dir))
current_tube.pod_stopped(src, dir)
@@ -139,7 +139,7 @@
COOLDOWN_START(src, move_cooldown, exit_delay)
return MOVE_ANIMATION_STAGE_ONE
- density = TRUE
+ set_density(TRUE)
moving = FALSE
return MOVE_ANIMATION_STAGE_ONE
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 68922053de3..e2ee7cb997f 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -41,7 +41,7 @@
air_update_turf(1)
/obj/structure/windoor_assembly/Destroy()
- density = FALSE
+ set_density(FALSE)
QDEL_NULL(electronics)
air_update_turf(1)
return ..()
@@ -183,7 +183,7 @@
for(var/obj/machinery/door/window/WD in loc)
if(WD.dir == dir)
return
- density = TRUE //Shouldn't matter but just incase
+ set_density(TRUE) //Shouldn't matter but just incase
to_chat(user, "You finish the [(src.secure) ? "secure" : ""] windoor.")
var/obj/machinery/door/window/windoor
if(secure)
@@ -203,7 +203,7 @@
windoor.icon_state = "rightopen"
windoor.base_state = "right"
windoor.setDir(dir)
- windoor.density = FALSE
+ windoor.set_density(FALSE)
windoor.unres_sides = electronics.unres_access_from
windoor.req_access = electronics.selected_accesses
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index e7c523bb15f..29861265e15 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -465,7 +465,7 @@ GLOBAL_LIST_INIT(wcCommon, pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e",
return TRUE
/obj/structure/window/Destroy()
- density = FALSE
+ set_density(FALSE)
air_update_turf(1)
update_nearby_icons()
return ..()
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 10d75a0ed08..75467493736 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -276,7 +276,7 @@
visuals.icon = 'icons/effects/fire.dmi'
visuals.icon_state = "2"
visuals.set_anchored(TRUE)
- visuals.density = TRUE
+ visuals.set_density(TRUE)
visuals.layer = FLY_LAYER
if(user)
diff --git a/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm b/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm
index 6c213b2516c..dccc8d4a303 100644
--- a/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm
+++ b/code/modules/antagonists/goon_vampire/goon_vampire_powers.dm
@@ -517,7 +517,7 @@
var/obj/effect/dummy/spell_jaunt/holder = new /obj/effect/dummy/spell_jaunt(originalloc)
var/atom/movable/overlay/animation = new /atom/movable/overlay(originalloc)
animation.name = "water"
- animation.density = FALSE
+ animation.set_density(FALSE)
animation.set_anchored(TRUE)
animation.icon = 'icons/mob/mob.dmi'
animation.icon_state = "liquify"
@@ -627,7 +627,7 @@
user.ExtinguishMob()
var/atom/movable/overlay/animation = new /atom/movable/overlay(get_turf(user))
animation.name = user.name
- animation.density = FALSE
+ animation.set_density(FALSE)
animation.set_anchored(TRUE)
animation.icon = user.icon
animation.alpha = 127
diff --git a/code/modules/antagonists/space_ninja/suit/ninja_equipment_actions/ninja_johyo.dm b/code/modules/antagonists/space_ninja/suit/ninja_equipment_actions/ninja_johyo.dm
index 47dc87be3c3..e6b9c7369d0 100644
--- a/code/modules/antagonists/space_ninja/suit/ninja_equipment_actions/ninja_johyo.dm
+++ b/code/modules/antagonists/space_ninja/suit/ninja_equipment_actions/ninja_johyo.dm
@@ -107,9 +107,9 @@
if(!target_living.anchored && target_living.loc)
target_living.visible_message(span_danger("[target_living] is snagged by [firer]'s chain!"))
var/old_density = target_living.density
- target_living.density = FALSE // Ensures the hook does not hit the target multiple times
+ target_living.set_density(FALSE) // Ensures the hook does not hit the target multiple times
target_living.forceMove(get_turf(firer))
- target_living.density = old_density
+ target_living.set_density(old_density)
/obj/item/projectile/johyo/Destroy()
QDEL_NULL(chain)
diff --git a/code/modules/antagonists/traitor/contractor/items/contractor_hardsuit.dm b/code/modules/antagonists/traitor/contractor/items/contractor_hardsuit.dm
index cdc96bf4215..ff3bebe0160 100644
--- a/code/modules/antagonists/traitor/contractor/items/contractor_hardsuit.dm
+++ b/code/modules/antagonists/traitor/contractor/items/contractor_hardsuit.dm
@@ -181,9 +181,9 @@
L.visible_message("[L] is snagged by [firer]'s hook!")
var/old_density = L.density
- L.density = FALSE // Ensures the hook does not hit the target multiple times
+ L.set_density(FALSE) // Ensures the hook does not hit the target multiple times
L.forceMove(get_turf(firer))
- L.density = old_density
+ L.set_density(old_density)
firer.drop_item_ground(src)
diff --git a/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm b/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm
index 5f18d1c5e36..40ecf751ce8 100644
--- a/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm
+++ b/code/modules/antagonists/vampire/vampire_powers/bestia_powers.dm
@@ -1038,7 +1038,7 @@
var/self_message = death_provoked ? span_userdanger("You can't take the strain of sustaining [user]'s shape in this condition, it begins to fall apart!") : span_notice("You start to transform back into human.")
user.visible_message(span_warning("[user] shape becomes fuzzy before it takes human form!"), self_message, span_italics("You hear an eerie rustle of many wings..."))
- user.density = FALSE
+ user.set_density(FALSE)
original_body.dir = SOUTH
original_body.forceMove(get_turf(user))
original_body.canmove = FALSE
diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm
index dbb9a80d44b..ecf51d0abc1 100644
--- a/code/modules/assembly/infrared.dm
+++ b/code/modules/assembly/infrared.dm
@@ -94,13 +94,13 @@
emission_cycles = 0
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(T)
I.master = src
- I.density = TRUE
+ I.set_density(TRUE)
I.dir = dir
I.update_icon()
first = I
step(I, I.dir)
if(first)
- I.density = FALSE
+ I.set_density(FALSE)
I.vis_spread(visible)
I.limit = 8
I.process()
@@ -290,14 +290,14 @@
if(!next && (limit > 0))
var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(loc)
I.master = master
- I.density = TRUE
+ I.set_density(TRUE)
I.dir = dir
I.update_icon()
I.previous = src
next = I
step(I, I.dir)
if(next)
- I.density = FALSE
+ I.set_density(FALSE)
I.vis_spread(visible)
I.limit = limit - 1
master.last = I
diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm
index 4ecc45ba7a5..aae89c32034 100644
--- a/code/modules/atmospherics/machinery/portable/canister.dm
+++ b/code/modules/atmospherics/machinery/portable/canister.dm
@@ -223,7 +223,7 @@ GLOBAL_DATUM_INIT(canister_icon_container, /datum/canister_icons, new())
air_update_turf()
stat |= BROKEN
- density = FALSE
+ set_density(FALSE)
playsound(loc, 'sound/effects/spray.ogg', 10, TRUE, -3)
update_icon()
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index c4049335180..b0590114653 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -18,7 +18,7 @@ GLOBAL_DATUM_INIT(the_gateway, /obj/machinery/gateway/centerstation, null)
/obj/machinery/gateway/proc/update_density_from_dir()
if(dir == SOUTH)
- density = FALSE
+ set_density(FALSE)
/obj/machinery/gateway/update_icon_state()
diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm
index e7476b08a34..b7e11669d7c 100644
--- a/code/modules/clothing/spacesuits/chronosuit.dm
+++ b/code/modules/clothing/spacesuits/chronosuit.dm
@@ -79,7 +79,7 @@
phaseanim.name = "phasing [user.name]"
phaseanim.icon = 'icons/mob/mob.dmi'
phaseanim.icon_state = "chronostuck"
- phaseanim.density = 1
+ phaseanim.set_density(TRUE)
phaseanim.layer = FLY_LAYER
phaseanim.master = user
user.ExtinguishMob()
diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm
index 003630a25f2..2c10e427ab5 100644
--- a/code/modules/events/spacevine.dm
+++ b/code/modules/events/spacevine.dm
@@ -324,7 +324,7 @@
/datum/spacevine_mutation/woodening/on_grow(obj/structure/spacevine/holder)
if(holder.energy)
- holder.density = TRUE
+ holder.set_density(TRUE)
holder.max_integrity = 100
holder.obj_integrity = holder.max_integrity
diff --git a/code/modules/mini_games/thunderdome/thunderdome_battle.dm b/code/modules/mini_games/thunderdome/thunderdome_battle.dm
index 2f238e557de..2315f6dcdc4 100644
--- a/code/modules/mini_games/thunderdome/thunderdome_battle.dm
+++ b/code/modules/mini_games/thunderdome/thunderdome_battle.dm
@@ -107,7 +107,7 @@ GLOBAL_VAR_INIT(tdome_arena_melee, locate(/area/tdome/newtdome/CQC))
if(M.id_tag != "TD_CloseCombat")
continue
M.do_animate("closing")
- M.density = TRUE
+ M.set_density(TRUE)
M.set_opacity(1)
M.layer = M.closingLayer
M.update_icon()
@@ -118,7 +118,7 @@ GLOBAL_VAR_INIT(tdome_arena_melee, locate(/area/tdome/newtdome/CQC))
continue
if(M.density)
M.do_animate("opening")
- M.density = FALSE
+ M.set_density(FALSE)
M.set_opacity(0)
M.update_icon()
diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm
index a26f5922b8c..4e4184a850d 100644
--- a/code/modules/mining/fulton.dm
+++ b/code/modules/mining/fulton.dm
@@ -91,7 +91,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
M.buckled?.unbuckle_mob(force = TRUE) // Unbuckle them to prevent anchoring problems
else
A.set_anchored(TRUE)
- A.density = FALSE
+ A.set_density(FALSE)
var/obj/effect/extraction_holder/holder_obj = new(A.loc)
holder_obj.appearance = A.appearance
A.forceMove(holder_obj)
@@ -147,7 +147,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
sleep(4)
holder_obj.cut_overlay(balloon3)
A.set_anchored(FALSE) // An item has to be unanchored to be extracted in the first place.
- A.density = initial(A.density)
+ A.set_density(initial(A.density))
animate(holder_obj, pixel_z = 0, time = 5)
sleep(5)
A.forceMove(holder_obj.loc)
diff --git a/code/modules/mining/lavaland/loot/tendril_loot.dm b/code/modules/mining/lavaland/loot/tendril_loot.dm
index 033b5d18d27..f20ed3542e9 100644
--- a/code/modules/mining/lavaland/loot/tendril_loot.dm
+++ b/code/modules/mining/lavaland/loot/tendril_loot.dm
@@ -395,9 +395,9 @@
if(!L.anchored && L.loc)
L.visible_message("[L] is snagged by [firer]'s hook!")
var/old_density = L.density
- L.density = FALSE // Ensures the hook does not hit the target multiple times
+ L.set_density(FALSE) // Ensures the hook does not hit the target multiple times
L.forceMove(get_turf(firer))
- L.density = old_density
+ L.set_density(old_density)
/obj/item/projectile/hook/Destroy()
QDEL_NULL(chain)
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 1a50523ff57..7398f9f1f79 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -141,7 +141,7 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
rename_character(null, pickedName)
set_anchored(TRUE)
canmove = FALSE
- density = 1
+ set_density(TRUE)
loc = loc
holo_icon = getHologramIcon(icon('icons/mob/ai.dmi',"holo1"))
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index 46bfd4796d4..c5dc335bb42 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -539,7 +539,7 @@
/mob/living/silicon/pai/update_canmove(delay_action_updates = 0)
. = ..()
- density = 0 //this is reset every canmove update otherwise
+ set_density(FALSE) //this is reset every canmove update otherwise
/mob/living/silicon/pai/examine(mob/user)
. = ..()
diff --git a/code/modules/mob/living/silicon/robot/drone/drone.dm b/code/modules/mob/living/silicon/robot/drone/drone.dm
index 3b6775385f8..3305a53e286 100644
--- a/code/modules/mob/living/silicon/robot/drone/drone.dm
+++ b/code/modules/mob/living/silicon/robot/drone/drone.dm
@@ -245,7 +245,7 @@
addtimer(CALLBACK(src, PROC_REF(shut_down), TRUE), EMAG_TIMER)
emagged = 1
- density = 1
+ set_density(TRUE)
pass_flags = 0
icon_state = "repairbot-emagged"
holder_type = /obj/item/holder/drone/emagged
@@ -391,7 +391,7 @@
/mob/living/silicon/robot/drone/update_canmove(delay_action_updates = 0)
. = ..()
- density = emagged //this is reset every canmove update otherwise
+ set_density(emagged) //this is reset every canmove update otherwise
/mob/living/simple_animal/drone/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0)
if(affect_silicon)
diff --git a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm
index dceb3ff8105..40d63fedce4 100644
--- a/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm
+++ b/code/modules/mob/living/simple_animal/hostile/floorcluwne.dm
@@ -184,13 +184,13 @@
layer = GAME_PLANE
invisibility = INVISIBILITY_MAXIMUM
mouse_opacity = 0
- density = FALSE
+ set_density(FALSE)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Appear()//handled in a seperate proc so floor cluwne doesn't appear before the animation finishes
layer = MOB_LAYER
invisibility = FALSE
mouse_opacity = 1
- density = TRUE
+ set_density(TRUE)
/mob/living/simple_animal/hostile/floor_cluwne/proc/Reset_View(screens, color, mob/living/carbon/human/H)
@@ -351,7 +351,7 @@
H.layer = GAME_PLANE
H.invisibility = INVISIBILITY_MAXIMUM
H.mouse_opacity = 0
- H.density = FALSE
+ H.set_density(FALSE)
H.set_anchored(TRUE)
addtimer(CALLBACK(src, TYPE_PROC_REF(/mob/living/simple_animal/hostile/floor_cluwne, Kill), H), 100)
H.visible_message("[src] pulls [H] under the floor!")
@@ -388,7 +388,7 @@
H.layer = initial(H.layer)
H.invisibility = initial(H.invisibility)
H.mouse_opacity = initial(H.mouse_opacity)
- H.density = initial(H.density)
+ H.set_density(initial(H.density))
H.set_anchored(initial(H.anchored))
eating = FALSE
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
index 6ab199458cc..eb50ec03321 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm
@@ -314,7 +314,7 @@ Difficulty: Medium
return
stop_automated_movement = TRUE
swooping |= SWOOP_DAMAGEABLE
- density = FALSE
+ set_density(FALSE)
icon_state = "shadow"
visible_message("[src] swoops up high!")
@@ -391,7 +391,7 @@ Difficulty: Medium
for(var/mob/M in range(7, src))
shake_camera(M, 15, 1)
- density = TRUE
+ set_density(TRUE)
SLEEP_CHECK_DEATH(1)
swooping &= ~SWOOP_DAMAGEABLE
SetRecoveryTime(swoop_cooldown)
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
index b3e8b53fcb0..2155bb85d38 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm
@@ -374,13 +374,13 @@ Difficulty: Hard
animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out
SLEEP_CHECK_DEATH(1)
visible_message("[src] fades out!")
- density = FALSE
+ set_density(FALSE)
SLEEP_CHECK_DEATH(2)
forceMove(T)
SLEEP_CHECK_DEATH(1)
animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN
SLEEP_CHECK_DEATH(1)
- density = TRUE
+ set_density(TRUE)
visible_message("[src] fades in!")
SLEEP_CHECK_DEATH(1) //at this point the blasts we made detonate
blinking = FALSE
diff --git a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
index b7efdfdde65..e90312dda34 100644
--- a/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
+++ b/code/modules/mob/living/simple_animal/hostile/megafauna/megafauna.dm
@@ -187,8 +187,8 @@
/mob/living/simple_animal/hostile/megafauna/DestroySurroundings()
. = ..()
for(var/turf/simulated/floor/chasm/C in circlerangeturfs(src, 1))
- C.density = FALSE //I hate it.
- addtimer(VARSET_CALLBACK(C, density, TRUE), 2 SECONDS) // Needed to make them path. I hate it.
+ C.set_density(FALSE) //I hate it.
+ addtimer(CALLBACK(C, TYPE_PROC_REF(/atom, set_density), TRUE), 2 SECONDS) // Needed to make them path. I hate it.
/datum/action/innate/megafauna_attack
name = "Megafauna Attack"
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/lurker.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/lurker.dm
index 7bdab378ddf..f85a7744c12 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/lurker.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/lurker.dm
@@ -71,7 +71,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/lurker/spider_special_action()
if(prob(prob_ai_massweb))
for(var/turf/simulated/T in oview(2,get_turf(src)))
- if(T.density == 0)
+ if(!T.density)
var/obj/structure/spider/terrorweb/W = locate() in T
if(!W)
new web_type(T)
diff --git a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm
index d79deaf50d4..64efac8eb12 100644
--- a/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm
+++ b/code/modules/mob/living/simple_animal/hostile/terror_spiders/terror_ai.dm
@@ -326,7 +326,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/ListValidTurfs()
var/list/potentials = list()
for(var/turf/simulated/T in oview(3,get_turf(src)))
- if(T.density == 0 && get_dist(get_turf(src),T) == 3)
+ if(!T.density && get_dist(get_turf(src),T) == 3)
var/obj/structure/spider/terrorweb/W = locate() in T
if(!W)
var/obj/structure/grille/G = locate() in T
@@ -339,7 +339,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/ListWebbedTurfs()
var/list/webbed = list()
for(var/turf/simulated/T in oview(3,get_turf(src)))
- if(T.density == 0 && get_dist(get_turf(src),T) == 3)
+ if(!T.density && get_dist(get_turf(src),T) == 3)
var/obj/structure/spider/terrorweb/W = locate() in T
if(W)
webbed += T
@@ -348,7 +348,7 @@
/mob/living/simple_animal/hostile/poison/terror_spider/proc/ListVisibleTurfs()
var/list/vturfs = list()
for(var/turf/simulated/T in oview(7,get_turf(src)))
- if(T.density == 0)
+ if(!T.density)
vturfs += T
return vturfs
diff --git a/code/modules/mob/living/simple_animal/hulk_power.dm b/code/modules/mob/living/simple_animal/hulk_power.dm
index 45cf649abbf..f00e7d0ea66 100644
--- a/code/modules/mob/living/simple_animal/hulk_power.dm
+++ b/code/modules/mob/living/simple_animal/hulk_power.dm
@@ -145,7 +145,7 @@
H.Weaken(4 SECONDS)
if(i > 20)
user.canmove = FALSE
- user.density = 0
+ user.set_density(FALSE)
for(var/mob/living/M in T.contents)
if(!M.lying_angle)
var/turf/target = get_turf(get_step(user,cur_dir))
@@ -191,7 +191,7 @@
else if(i < 30)
step(user, cur_dir)
sleep(1)
- user.density = 1
+ user.set_density(TRUE)
user.canmove = TRUE
user.layer = prevLayer
else
@@ -266,7 +266,7 @@
tile.break_tile()
var/o=3
for(var/i=0, i<14, i++)
- user.density = 0
+ user.set_density(FALSE)
user.canmove = FALSE
o++
if(o == 4)
@@ -306,7 +306,7 @@
spawn(i)
if(i < 3) M.pixel_y += 8
else M.pixel_y -= 8
- user.density = 1
+ user.set_density(TRUE)
user.canmove = TRUE
user.layer = prevLayer
else
diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm
index b5f4bd3ebaa..84cd6f22606 100644
--- a/code/modules/mob/living/simple_animal/simple_animal.dm
+++ b/code/modules/mob/living/simple_animal/simple_animal.dm
@@ -409,7 +409,7 @@
icon_state = icon_dead
if(flip_on_death)
transform = transform.Turn(180)
- density = 0
+ set_density(FALSE)
if(collar_type)
collar_type = "[initial(collar_type)]_dead"
regenerate_icons()
@@ -467,11 +467,10 @@
/mob/living/simple_animal/revive()
..()
- density = initial(density)
+ set_density(initial(density))
health = maxHealth
icon = initial(icon)
icon_state = icon_living
- density = initial(density)
update_canmove()
if(collar_type)
collar_type = "[initial(collar_type)]"
diff --git a/code/modules/mob/living/update_status.dm b/code/modules/mob/living/update_status.dm
index ad153458581..28cc629b6a2 100644
--- a/code/modules/mob/living/update_status.dm
+++ b/code/modules/mob/living/update_status.dm
@@ -95,7 +95,7 @@
fall(fall_over)
canmove = !(fall_over || resting || IsStunned() || IsFrozen() || buckled || IsImmobilized())
- density = !lying_angle
+ set_density(!lying_angle)
if(lying_angle)
if(layer == initial(layer))
layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index b4f87833177..24290806b47 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -997,9 +997,9 @@
var/turf/T = get_turf(src)
if(M.loc != T)
var/old_density = density
- density = FALSE
+ set_density(FALSE)
var/can_step = step_towards(M, T)
- density = old_density
+ set_density(old_density)
if(!can_step)
return 0
return ..()
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index 477d8c3fc08..9779d4a9fbc 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -173,7 +173,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne
if(count == 5) // Middle
center_part = part
if(count <= 3) // Their sprite is the top part of the generator
- part.density = FALSE
+ part.set_density(FALSE)
part.layer = WALL_OBJ_LAYER
part.sprite_number = count
part.main_part = src
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index 396e71ddbc6..71efcff3473 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -67,7 +67,7 @@
C.ptype = ptype
C.update()
C.set_anchored(FALSE)
- C.density = TRUE
+ C.set_density(TRUE)
if(!QDELING(src))
qdel(src)
@@ -218,7 +218,7 @@
C.ptype = deconstructs_to
C.update()
C.set_anchored(TRUE)
- C.density = TRUE
+ C.set_density(TRUE)
qdel(src)
// mouse drop another mob or self
diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm
index ff3f2bf274b..c25d1008d49 100644
--- a/code/modules/recycling/disposal/construction.dm
+++ b/code/modules/recycling/disposal/construction.dm
@@ -199,19 +199,15 @@
return
if(anchored)
set_anchored(FALSE)
+ set_density(!ispipe)
if(ispipe)
level = 2
- density = 0
- else
- density = 1
to_chat(user, "You detach the [nicetype] from the underfloor.")
else
set_anchored(TRUE)
+ set_density(!ispipe)
if(ispipe)
level = 1 // We don't want disposal bins to disappear under the floors
- density = 0
- else
- density = 1 // We don't want disposal bins or outlets to go density 0
to_chat(user, "You attach the [nicetype] to the underfloor.")
playsound(src.loc, I.usesound, 100, 1)
update()
diff --git a/code/modules/recycling/disposal/outlet.dm b/code/modules/recycling/disposal/outlet.dm
index f05192559ec..10dfb6aa8ac 100644
--- a/code/modules/recycling/disposal/outlet.dm
+++ b/code/modules/recycling/disposal/outlet.dm
@@ -75,7 +75,7 @@
C.ptype = PIPE_DISPOSALS_OUTLET
C.update()
C.set_anchored(TRUE)
- C.density = TRUE
+ C.set_density(TRUE)
transfer_fingerprints_to(C)
qdel(src)
@@ -97,5 +97,5 @@
C.ptype = PIPE_DISPOSALS_OUTLET
C.update()
C.set_anchored(FALSE)
- C.density = TRUE
+ C.set_density(TRUE)
qdel(src)
diff --git a/code/modules/recycling/disposal/pipe.dm b/code/modules/recycling/disposal/pipe.dm
index d4dcd013aaf..afd19380984 100644
--- a/code/modules/recycling/disposal/pipe.dm
+++ b/code/modules/recycling/disposal/pipe.dm
@@ -259,7 +259,7 @@
C.ptype = PIPE_DISPOSALS_SORT_LEFT
src.transfer_fingerprints_to(C)
C.dir = dir
- C.density = FALSE
+ C.set_density(FALSE)
C.set_anchored(TRUE)
C.update()
diff --git a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm
index 1f7d4e33326..38d18b52c57 100644
--- a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm
+++ b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm
@@ -107,7 +107,7 @@
sleep(1)
playsound(T, 'sound/effects/stonedoor_openclose.ogg', 300, TRUE, frequency = 80000)
sleep(1)
- density = TRUE
+ set_density(TRUE)
sleep(1)
var/turf/sight_blocker_turf = get_turf(src)
if(sight_blocker_distance)
@@ -131,7 +131,7 @@
sleep(22)
sight_blocker.forceMove(src)
sleep(5)
- density = FALSE
+ set_density(FALSE)
sleep(5)
open = TRUE
changing_openness = FALSE
diff --git a/code/modules/spacepods/parts.dm b/code/modules/spacepods/parts.dm
index 49309e261f4..d729ae72207 100644
--- a/code/modules/spacepods/parts.dm
+++ b/code/modules/spacepods/parts.dm
@@ -77,7 +77,7 @@
if(O.tool_behaviour == TOOL_WRENCH)
to_chat(user, "You [!anchored ? "secure \the [src] in place." : "remove the securing bolts."]")
set_anchored(!anchored)
- density = anchored
+ set_density(anchored)
playsound(get_turf(src), O.usesound, 50, 1)
/obj/item/pod_parts/pod_frame/verb/rotate()
diff --git a/code/modules/station_goals/brs/brs_portable_scanner.dm b/code/modules/station_goals/brs/brs_portable_scanner.dm
index 1d2e98bc5c3..02ddc560b08 100644
--- a/code/modules/station_goals/brs/brs_portable_scanner.dm
+++ b/code/modules/station_goals/brs/brs_portable_scanner.dm
@@ -244,10 +244,7 @@
return
// Update density
- if(anchored)
- density = TRUE
- else
- density = FALSE
+ set_density(anchored)
/obj/machinery/brs_portable_scanner/welder_act(mob/user, obj/item/I)
. = TRUE