diff --git a/code/datums/ai/dog/dog_behaviors.dm b/code/datums/ai/dog/dog_behaviors.dm index 00ac1973beb..bf29d942ad2 100644 --- a/code/datums/ai/dog/dog_behaviors.dm +++ b/code/datums/ai/dog/dog_behaviors.dm @@ -143,7 +143,7 @@ simple_pawn.icon_state = simple_pawn.icon_dead if(simple_pawn.flip_on_death) simple_pawn.transform = simple_pawn.transform.Turn(180) - simple_pawn.density = FALSE + simple_pawn.set_density(FALSE) if(DT_PROB(10, delta_time)) finish_action(controller, TRUE) @@ -158,7 +158,7 @@ simple_pawn.icon_state = simple_pawn.icon_living if(simple_pawn.flip_on_death) simple_pawn.transform = simple_pawn.transform.Turn(180) - simple_pawn.density = initial(simple_pawn.density) + simple_pawn.set_density(initial(simple_pawn.density)) /// This behavior involves either eating a snack we can reach, or begging someone holding a snack /datum/ai_behavior/harass diff --git a/code/datums/components/container_item/tank_holder.dm b/code/datums/components/container_item/tank_holder.dm index 765335987ce..4bcc6cdce90 100644 --- a/code/datums/components/container_item/tank_holder.dm +++ b/code/datums/components/container_item/tank_holder.dm @@ -26,6 +26,6 @@ else I.forceMove(container) container.tank = I - container.density = make_density + container.set_density(make_density) container.icon_state = tank_holder_icon_state return TRUE diff --git a/code/datums/components/riding/riding_mob.dm b/code/datums/components/riding/riding_mob.dm index 24f212ddb9f..67b7a2544ad 100644 --- a/code/datums/components/riding/riding_mob.dm +++ b/code/datums/components/riding/riding_mob.dm @@ -155,7 +155,7 @@ human_parent.buckle_lying = 0 // the riding mob is made nondense so they don't bump into any dense atoms the carrier is pulling, // since pulled movables are moved before buckled movables - riding_mob.density = FALSE + riding_mob.set_density(FALSE) else if(ride_check_flags & CARRIER_NEEDS_ARM) // fireman human_parent.buckle_lying = 90 @@ -179,7 +179,7 @@ unequip_buckle_inhands(parent) var/mob/living/carbon/human/H = parent H.remove_movespeed_modifier(/datum/movespeed_modifier/human_carry) - former_rider.density = TRUE + former_rider.set_density(TRUE) return ..() /// If the carrier shoves the person they're carrying, force the carried mob off diff --git a/code/datums/components/shrink.dm b/code/datums/components/shrink.dm index 464360da77e..03b454809aa 100644 --- a/code/datums/components/shrink.dm +++ b/code/datums/components/shrink.dm @@ -10,7 +10,7 @@ parent_atom.transform = parent_atom.transform.Scale(0.5,0.5) olddens = parent_atom.density oldopac = parent_atom.opacity - parent_atom.density = 0 + parent_atom.set_density(FALSE) parent_atom.set_opacity(FALSE) if(isliving(parent_atom)) var/mob/living/L = parent_atom @@ -30,7 +30,7 @@ /datum/component/shrink/Destroy() var/atom/parent_atom = parent parent_atom.transform = parent_atom.transform.Scale(2,2) - parent_atom.density = olddens + parent_atom.set_density(olddens) parent_atom.set_opacity(oldopac) if(isliving(parent_atom)) var/mob/living/L = parent_atom diff --git a/code/datums/elements/climbable.dm b/code/datums/elements/climbable.dm index 7bdc037e38c..8084247669a 100644 --- a/code/datums/elements/climbable.dm +++ b/code/datums/elements/climbable.dm @@ -80,9 +80,9 @@ /datum/element/climbable/proc/do_climb(atom/climbed_thing, mob/living/user) - climbed_thing.density = FALSE + climbed_thing.set_density(FALSE) . = step(user, get_dir(user,climbed_thing.loc)) - climbed_thing.density = TRUE + climbed_thing.set_density(TRUE) ///Handles climbing onto the atom when you click-drag /datum/element/climbable/proc/mousedrop_receive(atom/climbed_thing, atom/movable/dropped_atom, mob/user) diff --git a/code/game/atoms.dm b/code/game/atoms.dm index 79094e979d5..482ee3a3dc1 100644 --- a/code/game/atoms.dm +++ b/code/game/atoms.dm @@ -1845,6 +1845,16 @@ /atom/proc/get_custom_material_amount() return isnull(custom_materials) ? 0 : counterlist_sum(custom_materials) + +///Setter for the `density` variable to append behavior related to its changing. +/atom/proc/set_density(new_value) + SHOULD_CALL_PARENT(TRUE) + if(density == new_value) + return + . = density + density = new_value + + ///Setter for the `base_pixel_x` variable to append behavior related to its changing. /atom/proc/set_base_pixel_x(new_value) if(base_pixel_x == new_value) diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index f1d78ae41f3..7e3947c7c0c 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -227,7 +227,7 @@ */ /obj/machinery/proc/open_machine(drop = TRUE) state_open = TRUE - density = FALSE + set_density(FALSE) if(drop) dump_inventory_contents() update_appearance() @@ -294,7 +294,7 @@ /obj/machinery/proc/close_machine(atom/movable/target = null) state_open = FALSE - density = TRUE + set_density(TRUE) if(!target) for(var/am in loc) if (!(can_be_occupant(am))) diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm index f9bbc8bcafd..d6e52c32a6c 100644 --- a/code/game/machinery/cryopod.dm +++ b/code/game/machinery/cryopod.dm @@ -135,7 +135,7 @@ GLOBAL_LIST_EMPTY(cryopod_computers) /obj/machinery/cryopod/open_machine() ..() icon_state = "cryopod-open" - density = TRUE + set_density(TRUE) name = initial(name) /obj/machinery/cryopod/container_resist_act(mob/living/user) diff --git a/code/game/machinery/deployable.dm b/code/game/machinery/deployable.dm index 2f945b7bb32..f3f48a7365e 100644 --- a/code/game/machinery/deployable.dm +++ b/code/game/machinery/deployable.dm @@ -135,7 +135,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 0070c3435b2..556c82f84e6 100644 --- a/code/game/machinery/doors/airlock.dm +++ b/code/game/machinery/doors/airlock.dm @@ -1084,7 +1084,7 @@ set_opacity(0) update_freelook_sight() sleep(4) - density = FALSE + set_density(FALSE) flags_1 &= ~PREVENT_CLICK_UNDER_1 air_update_turf(TRUE, FALSE) sleep(1) @@ -1129,12 +1129,12 @@ update_icon(ALL, AIRLOCK_CLOSING, 1) layer = CLOSED_DOOR_LAYER if(air_tight) - density = TRUE + set_density(TRUE) flags_1 |= PREVENT_CLICK_UNDER_1 air_update_turf(TRUE, TRUE) sleep(1) if(!air_tight) - density = TRUE + set_density(TRUE) flags_1 |= PREVENT_CLICK_UNDER_1 air_update_turf(TRUE, TRUE) sleep(4) diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm index 7e3635f1895..aa40873bd8b 100644 --- a/code/game/machinery/doors/door.dm +++ b/code/game/machinery/doors/door.dm @@ -335,7 +335,7 @@ do_animate("opening") set_opacity(0) sleep(5) - density = FALSE + set_density(FALSE) flags_1 &= ~PREVENT_CLICK_UNDER_1 sleep(5) layer = initial(layer) @@ -365,7 +365,7 @@ do_animate("closing") layer = closingLayer sleep(5) - density = TRUE + set_density(TRUE) flags_1 |= PREVENT_CLICK_UNDER_1 sleep(5) update_appearance() diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm index 960e0f2e38b..98c05228d5c 100644 --- a/code/game/machinery/doors/windowdoor.dm +++ b/code/game/machinery/doors/windowdoor.dm @@ -54,7 +54,7 @@ AddComponent(/datum/component/ntnet_interface) /obj/machinery/door/window/Destroy() - density = FALSE + set_density(FALSE) QDEL_LIST(debris) if(obj_integrity == 0) playsound(src, "shatter", 70, TRUE) @@ -163,7 +163,7 @@ playsound(src, 'sound/machines/windowdoor.ogg', 100, TRUE) icon_state ="[base_state]open" sleep(10) - density = FALSE + set_density(FALSE) air_update_turf(TRUE, FALSE) update_freelook_sight() @@ -185,7 +185,7 @@ playsound(src, 'sound/machines/windowdoor.ogg', 100, TRUE) icon_state = base_state - density = TRUE + set_density(TRUE) air_update_turf(TRUE, TRUE) update_freelook_sight() sleep(10) diff --git a/code/game/machinery/shieldgen.dm b/code/game/machinery/shieldgen.dm index bd2d5715dcd..558c366fa39 100644 --- a/code/game/machinery/shieldgen.dm +++ b/code/game/machinery/shieldgen.dm @@ -99,7 +99,7 @@ *The barrier itself is not intended to interact with the conceal runes cult spell for balance purposes. */ /obj/structure/emergency_shield/cult/barrier/proc/Toggle() - density = !density + set_density(!density) air_update_turf(TRUE, !density) invisibility = initial(invisibility) if(!density) diff --git a/code/game/machinery/washing_machine.dm b/code/game/machinery/washing_machine.dm index 8825ac893a8..965f21f3b36 100644 --- a/code/game/machinery/washing_machine.dm +++ b/code/game/machinery/washing_machine.dm @@ -373,5 +373,5 @@ GLOBAL_LIST_INIT(dye_registry, list( /obj/machinery/washing_machine/open_machine(drop = 1) ..() - density = TRUE //because machinery/open_machine() sets it to 0 + set_density(TRUE) //because machinery/open_machine() sets it to FALSE color_source = null diff --git a/code/game/objects/items/devices/powersink.dm b/code/game/objects/items/devices/powersink.dm index 70bfe2edc2a..44d110ab4b1 100644 --- a/code/game/objects/items/devices/powersink.dm +++ b/code/game/objects/items/devices/powersink.dm @@ -43,7 +43,7 @@ /obj/item/powersink/set_anchored(anchorvalue) . = ..() - density = anchorvalue + set_density(anchorvalue) /obj/item/powersink/proc/set_mode(value) if(value == mode) diff --git a/code/game/objects/structures/beds_chairs/bed.dm b/code/game/objects/structures/beds_chairs/bed.dm index f41e0c92389..9e23c7e846d 100644 --- a/code/game/objects/structures/beds_chairs/bed.dm +++ b/code/game/objects/structures/beds_chairs/bed.dm @@ -88,7 +88,7 @@ qdel(src) /obj/structure/bed/roller/post_buckle_mob(mob/living/M) - density = TRUE + set_density(TRUE) icon_state = "up" //Push them up from the normal lying position M.pixel_y = M.base_pixel_y @@ -100,7 +100,7 @@ /obj/structure/bed/roller/post_unbuckle_mob(mob/living/M) - density = FALSE + set_density(FALSE) icon_state = "down" //Set them back down to the normal lying position M.pixel_y = M.base_pixel_y + M.body_position_pixel_y_offset diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm index 07a7eaedd67..736e7f5f6ca 100644 --- a/code/game/objects/structures/crates_lockers/closets.dm +++ b/code/game/objects/structures/crates_lockers/closets.dm @@ -172,7 +172,7 @@ playsound(loc, open_sound, open_sound_volume, TRUE, -3) opened = TRUE if(!dense_when_open) - density = FALSE + set_density(FALSE) dump_contents() update_appearance() after_open(user, force) @@ -230,7 +230,7 @@ take_contents() playsound(loc, close_sound, close_sound_volume, TRUE, -3) opened = FALSE - density = TRUE + set_density(TRUE) update_appearance() after_close(user) return TRUE diff --git a/code/game/objects/structures/crates_lockers/closets/bodybag.dm b/code/game/objects/structures/crates_lockers/closets/bodybag.dm index a738699b026..3670fb22ba4 100644 --- a/code/game/objects/structures/crates_lockers/closets/bodybag.dm +++ b/code/game/objects/structures/crates_lockers/closets/bodybag.dm @@ -62,7 +62,7 @@ /obj/structure/closet/body_bag/close() . = ..() if(.) - density = FALSE + set_density(FALSE) mouse_drag_pointer = MOUSE_ACTIVE_POINTER /obj/structure/closet/body_bag/MouseDrop(over_object, src_location, over_location) diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm index 1ccf2dddbfa..519c4fa4653 100644 --- a/code/game/objects/structures/displaycase.dm +++ b/code/game/objects/structures/displaycase.dm @@ -85,7 +85,7 @@ /obj/structure/displaycase/obj_break(damage_flag) . = ..() if(!broken && !(flags_1 & NODECONSTRUCT_1)) - density = FALSE + set_density(FALSE) broken = TRUE new /obj/item/shard(drop_location()) playsound(src, "shatter", 70, TRUE) diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm index c13e42dc848..c5a0edbcb98 100644 --- a/code/game/objects/structures/false_walls.dm +++ b/code/game/objects/structures/false_walls.dm @@ -48,7 +48,7 @@ /obj/structure/falsewall/proc/toggle_open() if(!QDELETED(src)) - density = !density + set_density(!density) set_opacity(density) opening = FALSE update_appearance() diff --git a/code/game/objects/structures/fence.dm b/code/game/objects/structures/fence.dm index c6287bf2a56..98853f8a21d 100644 --- a/code/game/objects/structures/fence.dm +++ b/code/game/objects/structures/fence.dm @@ -92,7 +92,7 @@ /obj/structure/fence/proc/update_cut_status() if(!cuttable) return - density = TRUE + var/new_density = TRUE switch(hole_size) if(NO_HOLE) icon_state = initial(icon_state) @@ -100,7 +100,8 @@ icon_state = "straight_cut2" if(LARGE_HOLE) icon_state = "straight_cut3" - density = FALSE + new_density = FALSE + set_density(new_density) //FENCE DOORS @@ -134,7 +135,7 @@ playsound(src, 'sound/machines/click.ogg', 100, TRUE) /obj/structure/fence/door/proc/update_door_status() - density = !density + set_density(!density) icon_state = density ? "door_closed" : "door_opened" /obj/structure/fence/door/proc/can_open(mob/user) diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm index 15f4b2f7a46..0edd0311f0d 100644 --- a/code/game/objects/structures/grille.dm +++ b/code/game/objects/structures/grille.dm @@ -268,7 +268,7 @@ . = ..() if(!broken && !(flags_1 & NODECONSTRUCT_1)) icon_state = "brokengrille" - density = FALSE + set_density(FALSE) obj_integrity = 20 broken = TRUE rods_amount = 1 @@ -279,7 +279,7 @@ /obj/structure/grille/proc/repair_grille() if(broken) icon_state = "grille" - density = TRUE + set_density(TRUE) obj_integrity = max_integrity broken = FALSE rods_amount = 2 diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm index bd7ac1c3928..283343871dd 100644 --- a/code/game/objects/structures/mineral_doors.dm +++ b/code/game/objects/structures/mineral_doors.dm @@ -96,7 +96,7 @@ set_opacity(FALSE) flick("[initial(icon_state)]opening",src) sleep(10) - density = FALSE + set_density(FALSE) door_opened = TRUE layer = OPEN_DOOR_LAYER air_update_turf(TRUE, FALSE) @@ -116,7 +116,7 @@ playsound(src, closeSound, 100, TRUE) flick("[initial(icon_state)]closing",src) sleep(10) - density = TRUE + set_density(TRUE) set_opacity(TRUE) door_opened = FALSE layer = initial(layer) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index 5896a30935d..4fba931d0d8 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -689,7 +689,7 @@ /obj/structure/rack/deconstruct(disassembled = TRUE) if(!(flags_1&NODECONSTRUCT_1)) - 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/tank_holder.dm b/code/game/objects/structures/tank_holder.dm index 8c604a2f02e..4f7519e3d5c 100644 --- a/code/game/objects/structures/tank_holder.dm +++ b/code/game/objects/structures/tank_holder.dm @@ -106,7 +106,7 @@ /// and density. /obj/structure/tank_holder/proc/after_detach_tank() tank = null - density = FALSE + set_density(FALSE) icon_state = "holder" /obj/structure/tank_holder/oxygen diff --git a/code/game/objects/structures/training_machine.dm b/code/game/objects/structures/training_machine.dm index 14e85a9c775..ce66b7bce07 100644 --- a/code/game/objects/structures/training_machine.dm +++ b/code/game/objects/structures/training_machine.dm @@ -293,9 +293,9 @@ */ /obj/structure/training_machine/proc/handle_density() if(length(buckled_mobs) || attached_item) - density = TRUE + set_density(TRUE) else - density = FALSE + set_density(FALSE) /obj/structure/training_machine/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE) . = ..() 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 ae678c8496b..ea247bd25cf 100644 --- a/code/game/objects/structures/transit_tubes/transit_tube_pod.dm +++ b/code/game/objects/structures/transit_tubes/transit_tube_pod.dm @@ -149,14 +149,14 @@ setDir(next_dir) set_glide_size(DELAY_TO_GLIDE_SIZE(enter_delay + exit_delay)) 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) else addtimer(CALLBACK(src, .proc/move_animation, MOVE_ANIMATION_STAGE_ONE), exit_delay) return - density = TRUE + set_density(TRUE) moving = FALSE var/obj/structure/transit_tube/TT = locate(/obj/structure/transit_tube) in loc diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm index 79e0fe566ed..1eaf3325358 100644 --- a/code/game/objects/structures/watercloset.dm +++ b/code/game/objects/structures/watercloset.dm @@ -656,11 +656,11 @@ open = !open if(open) layer = SIGN_LAYER - density = FALSE + set_density(FALSE) set_opacity(FALSE) else layer = WALL_OBJ_LAYER - density = TRUE + set_density(TRUE) if(opaque_closed) set_opacity(TRUE) @@ -756,14 +756,14 @@ /obj/structure/curtain/cloth/fancy/mechanical/proc/open() icon_state = "[icon_type]-open" layer = SIGN_LAYER - density = FALSE + set_density(FALSE) open = TRUE set_opacity(FALSE) /obj/structure/curtain/cloth/fancy/mechanical/proc/close() icon_state = "[icon_type]-closed" layer = WALL_OBJ_LAYER - density = TRUE + set_density(TRUE) open = FALSE if(opaque_closed) set_opacity(TRUE) diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm index efe5503f1de..494f9494408 100644 --- a/code/game/objects/structures/windoor_assembly.dm +++ b/code/game/objects/structures/windoor_assembly.dm @@ -42,7 +42,7 @@ AddElement(/datum/element/connect_loc, src, loc_connections) /obj/structure/windoor_assembly/Destroy() - density = FALSE + set_density(FALSE) air_update_turf(TRUE, FALSE) return ..() @@ -258,7 +258,7 @@ if(W.use_tool(src, user, 40, volume=100) && electronics) - density = TRUE //Shouldn't matter but just incase + set_density(TRUE) //Shouldn't matter but just incase to_chat(user, span_notice("You finish the windoor.")) if(secure) @@ -270,7 +270,7 @@ windoor.icon_state = "rightsecureopen" windoor.base_state = "rightsecure" windoor.setDir(dir) - windoor.density = FALSE + windoor.set_density(FALSE) if(electronics.one_access) windoor.req_one_access = electronics.accesses @@ -293,7 +293,7 @@ windoor.icon_state = "rightopen" windoor.base_state = "right" windoor.setDir(dir) - windoor.density = FALSE + windoor.set_density(FALSE) if(electronics.one_access) windoor.req_one_access = electronics.accesses diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm index 85ef6282693..4cbb0318de0 100644 --- a/code/game/objects/structures/window.dm +++ b/code/game/objects/structures/window.dm @@ -305,7 +305,7 @@ set_opacity(initial(opacity)) /obj/structure/window/Destroy() - density = FALSE + set_density(FALSE) air_update_turf(TRUE, FALSE) update_nearby_icons() return ..() diff --git a/code/modules/antagonists/blob/structures/_blob.dm b/code/modules/antagonists/blob/structures/_blob.dm index cb04875651f..3c348943146 100644 --- a/code/modules/antagonists/blob/structures/_blob.dm +++ b/code/modules/antagonists/blob/structures/_blob.dm @@ -158,9 +158,9 @@ if(make_blob) //well, can we? var/obj/structure/blob/B = new /obj/structure/blob/normal(src.loc, (controller || overmind)) - B.density = TRUE + B.set_density(TRUE) if(T.Enter(B,src)) //NOW we can attempt to move into the tile - B.density = initial(B.density) + B.set_density(initial(B.density)) B.forceMove(T) B.update_appearance() if(B.overmind && expand_reaction) diff --git a/code/modules/antagonists/cult/cult_structures.dm b/code/modules/antagonists/cult/cult_structures.dm index 536ed60b533..e9b5f616c8c 100644 --- a/code/modules/antagonists/cult/cult_structures.dm +++ b/code/modules/antagonists/cult/cult_structures.dm @@ -10,7 +10,7 @@ var/cultist_examine_message /obj/structure/destructible/cult/proc/conceal() //for spells that hide cult presence - density = FALSE + set_density(FALSE) visible_message(span_danger("[src] fades away.")) invisibility = INVISIBILITY_OBSERVER alpha = 100 //To help ghosts distinguish hidden runes @@ -20,7 +20,7 @@ STOP_PROCESSING(SSfastprocess, src) /obj/structure/destructible/cult/proc/reveal() //for spells that reveal cult presence - density = initial(density) + set_density(initial(density)) invisibility = 0 visible_message(span_danger("[src] suddenly appears!")) alpha = initial(alpha) diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index 921681c01de..5f3bc781022 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -106,12 +106,12 @@ I.icon_state = "[initial(I.icon_state)]_[(assembly_holder.a_left == src) ? "l":"r"]" //Sync the offset of the beam with the position of the sensor. else if(istype(holder, /obj/item/transfer_valve)) I.icon_state = "[initial(I.icon_state)]_ttv" - I.density = TRUE + I.set_density(TRUE) if(!I.Move(_T)) qdel(I) switchListener(_T) break - I.density = FALSE + I.set_density(FALSE) beams += I I.master = src I.setDir(_dir) diff --git a/code/modules/atmospherics/machinery/portable/canister.dm b/code/modules/atmospherics/machinery/portable/canister.dm index 1953def7b05..35d1c9de866 100644 --- a/code/modules/atmospherics/machinery/portable/canister.dm +++ b/code/modules/atmospherics/machinery/portable/canister.dm @@ -525,7 +525,7 @@ GLOBAL_LIST_INIT(gas_id_to_canister, init_gas_id_to_canister()) obj_break() - density = FALSE + set_density(FALSE) playsound(src.loc, 'sound/effects/spray.ogg', 10, TRUE, -3) investigate_log("was destroyed.", INVESTIGATE_ATMOS) diff --git a/code/modules/cargo/supplypod.dm b/code/modules/cargo/supplypod.dm index 6d3daffaabe..393b90c8fb2 100644 --- a/code/modules/cargo/supplypod.dm +++ b/code/modules/cargo/supplypod.dm @@ -229,7 +229,7 @@ /obj/structure/closet/supplypod/proc/preOpen() //Called before the open_pod() proc. Handles anything that occurs right as the pod lands. var/turf/turf_underneath = get_turf(src) var/list/B = explosionSize //Mostly because B is more readable than explosionSize :p - density = TRUE //Density is originally false so the pod doesn't block anything while it's still falling through the air + set_density(TRUE) //Density is originally false so the pod doesn't block anything while it's still falling through the air AddComponent(/datum/component/pellet_cloud, projectile_type=shrapnel_type, magnitude=shrapnel_magnitude) if(effectShrapnel) SEND_SIGNAL(src, COMSIG_SUPPLYPOD_LANDED) @@ -417,17 +417,17 @@ /obj/structure/closet/supplypod/setOpened() //Proc exists here, as well as in any atom that can assume the role of a "holder" of a supplypod. Check the open_pod() proc for more details opened = TRUE - density = FALSE + set_density(FALSE) update_appearance() /obj/structure/closet/supplypod/extractionpod/setOpened() opened = TRUE - density = TRUE + set_density(TRUE) update_appearance() /obj/structure/closet/supplypod/setClosed() //Ditto opened = FALSE - density = TRUE + set_density(TRUE) update_appearance() /obj/structure/closet/supplypod/proc/tryMakeRubble(turf/T) //Ditto diff --git a/code/modules/events/spacevine.dm b/code/modules/events/spacevine.dm index 0e3f2376256..cc17c5409de 100644 --- a/code/modules/events/spacevine.dm +++ b/code/modules/events/spacevine.dm @@ -290,7 +290,7 @@ /datum/spacevine_mutation/woodening/on_grow(obj/structure/spacevine/holder) if(holder.energy) - holder.density = TRUE + holder.set_density(TRUE) holder.modify_max_integrity(100) /datum/spacevine_mutation/woodening/on_hit(obj/structure/spacevine/holder, mob/living/hitter, obj/item/I, expected_damage) diff --git a/code/modules/food_and_drinks/restaurant/_venue.dm b/code/modules/food_and_drinks/restaurant/_venue.dm index e90f9036f7b..d176e2f1ce4 100644 --- a/code/modules/food_and_drinks/restaurant/_venue.dm +++ b/code/modules/food_and_drinks/restaurant/_venue.dm @@ -101,15 +101,13 @@ desc = "A robot-only gate into the wonders of Space Station cuisine!" icon = 'icons/obj/machines/restaurant_portal.dmi' icon_state = "portal" - density = TRUE + anchored = TRUE + density = FALSE use_power = IDLE_POWER_USE idle_power_usage = 10 active_power_usage = 100 circuit = /obj/item/circuitboard/machine/restaurant_portal - layer = BELOW_OBJ_LAYER - density = FALSE - anchored = TRUE resistance_flags = INDESTRUCTIBLE | FIRE_PROOF | UNACIDABLE | ACID_PROOF ///What venue is this portal for? Uses a typepath which is turned into an instance on Initialize var/datum/venue/linked_venue = /datum/venue diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm index 6ac06558243..9b6659a8bb8 100644 --- a/code/modules/mining/fulton.dm +++ b/code/modules/mining/fulton.dm @@ -83,7 +83,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons) M.buckled.unbuckle_mob(M, 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) @@ -134,7 +134,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/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 002b4162acb..b8417294b83 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -943,9 +943,9 @@ if(target.loc != loc) var/old_density = density - density = FALSE + density = FALSE // Hacky and doesn't use set_density() step_towards(target, loc) - density = old_density + density = old_density // Avoid changing density directly in normal circumstances, without the setter. if(target.loc == loc) return buckle_mob(target, TRUE, TRUE, CARRIER_NEEDS_ARM) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index e88ec4b5444..53a923140d1 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -561,7 +561,7 @@ layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs ADD_TRAIT(src, TRAIT_UI_BLOCKED, LYING_DOWN_TRAIT) ADD_TRAIT(src, TRAIT_PULL_BLOCKED, LYING_DOWN_TRAIT) - density = FALSE // We lose density and stop bumping passable dense things. + set_density(FALSE) // We lose density and stop bumping passable dense things. if(HAS_TRAIT(src, TRAIT_FLOORED) && !(dir & (NORTH|SOUTH))) setDir(pick(NORTH, SOUTH)) // We are and look helpless. body_position_pixel_y_offset = PIXEL_Y_OFFSET_LYING @@ -571,7 +571,7 @@ /mob/living/proc/on_standing_up() if(layer == LYING_MOB_LAYER) layer = initial(layer) - density = initial(density) // We were prone before, so we become dense and things can bump into us again. + set_density(initial(density)) // We were prone before, so we become dense and things can bump into us again. REMOVE_TRAIT(src, TRAIT_UI_BLOCKED, LYING_DOWN_TRAIT) REMOVE_TRAIT(src, TRAIT_PULL_BLOCKED, LYING_DOWN_TRAIT) body_position_pixel_y_offset = 0 diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm index a7b1b90ae1f..979a7387827 100644 --- a/code/modules/mob/living/silicon/pai/pai_shell.dm +++ b/code/modules/mob/living/silicon/pai/pai_shell.dm @@ -20,7 +20,7 @@ addtimer(CALLBACK(src, .proc/emittercool), emittercd) REMOVE_TRAIT(src, TRAIT_IMMOBILIZED, PAI_FOLDED) REMOVE_TRAIT(src, TRAIT_HANDS_BLOCKED, PAI_FOLDED) - density = TRUE + set_density(TRUE) if(istype(card.loc, /obj/item/pda)) var/obj/item/pda/P = card.loc P.pai = null @@ -67,7 +67,7 @@ forceMove(card) ADD_TRAIT(src, TRAIT_IMMOBILIZED, PAI_FOLDED) ADD_TRAIT(src, TRAIT_HANDS_BLOCKED, PAI_FOLDED) - density = FALSE + set_density(FALSE) set_light(0) holoform = FALSE set_resting(resting) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm index 9ae192ad428..553a01b84cc 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm @@ -205,7 +205,7 @@ if(z != target.z) return hopping = TRUE - density = FALSE + set_density(FALSE) pass_flags |= PASSMOB notransform = TRUE var/turf/new_turf = locate((target.x + rand(-3,3)),(target.y + rand(-3,3)),target.z) @@ -218,7 +218,7 @@ throw_at(new_turf, max(3,get_dist(src,new_turf)), 1, src, FALSE, callback = CALLBACK(src, .proc/FinishHop)) /mob/living/simple_animal/hostile/jungle/leaper/proc/FinishHop() - density = TRUE + set_density(TRUE) notransform = FALSE pass_flags &= ~PASSMOB hopping = FALSE @@ -235,12 +235,12 @@ addtimer(CALLBACK(src, .proc/BellyFlopHop, new_turf), 30) /mob/living/simple_animal/hostile/jungle/leaper/proc/BellyFlopHop(turf/T) - density = FALSE + set_density(FALSE) throw_at(T, get_dist(src,T),1,src, FALSE, callback = CALLBACK(src, .proc/Crush)) /mob/living/simple_animal/hostile/jungle/leaper/proc/Crush() hopping = FALSE - density = TRUE + set_density(TRUE) notransform = FALSE playsound(src, 'sound/effects/meteorimpact.ogg', 200, TRUE) for(var/mob/living/L in orange(1, src)) diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm index 81d4ee4cd6d..9e92a5ed416 100644 --- a/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm +++ b/code/modules/mob/living/simple_animal/hostile/jungle/mook.dm @@ -109,7 +109,7 @@ /mob/living/simple_animal/hostile/jungle/mook/proc/LeapAttack() if(target && !stat && attack_state == MOOK_ATTACK_WARMUP) attack_state = MOOK_ATTACK_ACTIVE - density = FALSE + set_density(FALSE) melee_damage_lower = 30 melee_damage_upper = 30 update_icons() @@ -125,7 +125,7 @@ /mob/living/simple_animal/hostile/jungle/mook/proc/AttackRecovery() if(attack_state == MOOK_ATTACK_ACTIVE && !stat) attack_state = MOOK_ATTACK_RECOVERY - density = TRUE + set_density(TRUE) face_atom(target) if(!struck_target_leap) update_icons() @@ -158,7 +158,7 @@ if(CanAttack(L)) L.attack_animal(src) struck_target_leap = TRUE - density = TRUE + set_density(TRUE) update_icons() var/mook_under_us = FALSE for(var/A in get_turf(src)) @@ -171,7 +171,7 @@ if(!struck_target_leap && CanAttack(ML))//Check if some joker is attempting to use rest to evade us struck_target_leap = TRUE ML.attack_animal(src) - density = TRUE + set_density(TRUE) struck_target_leap = TRUE update_icons() continue 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 0e317ab1702..5a6602eb3b6 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/drake.dm @@ -316,7 +316,7 @@ return stop_automated_movement = TRUE swooping |= SWOOP_DAMAGEABLE - density = FALSE + set_density(FALSE) icon_state = "shadow" visible_message(span_boldwarning("[src] swoops up high!")) @@ -393,7 +393,7 @@ 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 4cfe57af32b..8e797fb87c7 100644 --- a/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm +++ b/code/modules/mob/living/simple_animal/hostile/megafauna/hierophant.dm @@ -343,13 +343,13 @@ Difficulty: Hard animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out SLEEP_CHECK_DEATH(1) visible_message(span_hierophant_warning("[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(span_hierophant_warning("[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/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm index 3a561f62405..0f7f3907477 100644 --- a/code/modules/mob/living/simple_animal/hostile/mimic.dm +++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm @@ -332,14 +332,14 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca if(locked) return if(!opened) - density = FALSE + set_density(FALSE) opened = TRUE icon_state = "crateopen" playsound(src, open_sound, 50, TRUE) for(var/atom/movable/AM in src) AM.forceMove(loc) else - density = TRUE + set_density(TRUE) opened = FALSE icon_state = "crate" playsound(src, close_sound, 50, TRUE) diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm index 4e3f3126ce3..6c9510c7675 100644 --- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm +++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/pandora.dm @@ -147,13 +147,13 @@ new /obj/effect/temp_visual/hierophant/blast/damaging/pandora(t, src) animate(src, alpha = 0, time = 2, easing = EASE_OUT) //fade out visible_message(span_hierophant_warning("[src] fades out!")) - density = FALSE + set_density(FALSE) addtimer(CALLBACK(src, .proc/pandora_teleport_3, T), 2) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/pandora_teleport_3(turf/T) forceMove(T) animate(src, alpha = 255, time = 2, easing = EASE_IN) //fade IN - density = TRUE + set_density(TRUE) visible_message(span_hierophant_warning("[src] fades in!")) /mob/living/simple_animal/hostile/asteroid/elite/pandora/proc/aoe_squares(target) diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index ec507c185dc..882746c6555 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -453,7 +453,7 @@ icon_state = icon_dead if(flip_on_death) transform = transform.Turn(180) - density = FALSE + set_density(FALSE) ..() /mob/living/simple_animal/proc/CanAttack(atom/the_target) @@ -487,7 +487,7 @@ if(!.) return icon_state = icon_living - density = initial(density) + set_density(initial(density)) /mob/living/simple_animal/proc/make_babies() // <3 <3 <3 if(gender != FEMALE || stat || next_scan_time > world.time || !childtype || !animal_species || !SSticker.IsRoundInProgress()) diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 2ef5ed9810e..f8ce056093f 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -977,9 +977,9 @@ var/turf/T = get_turf(src) if(M.loc != T) var/old_density = density - density = FALSE + density = FALSE // Hacky and doesn't use set_density() var/can_step = step_towards(M, T) - density = old_density + density = old_density // Avoid changing density directly in normal circumstances, without the setter. if(!can_step) return FALSE return ..() diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm index 0ee714c2437..6fd37f0ff32 100644 --- a/code/modules/power/gravitygenerator.dm +++ b/code/modules/power/gravitygenerator.dm @@ -166,7 +166,7 @@ GLOBAL_LIST_EMPTY(gravity_generators) // We will keep track of this by adding ne if(count == 5) // Middle middle = 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/bin.dm b/code/modules/recycling/disposal/bin.dm index 70cbd5ce561..41e9cc0c31f 100644 --- a/code/modules/recycling/disposal/bin.dm +++ b/code/modules/recycling/disposal/bin.dm @@ -247,7 +247,7 @@ stored.forceMove(T) src.transfer_fingerprints_to(stored) stored.set_anchored(FALSE) - stored.density = TRUE + stored.set_density(TRUE) stored.update_appearance() for(var/atom/movable/AM in src) //out, out, darned crowbar! AM.forceMove(T) diff --git a/code/modules/recycling/disposal/construction.dm b/code/modules/recycling/disposal/construction.dm index abf3d8eb93a..ccd505b64a1 100644 --- a/code/modules/recycling/disposal/construction.dm +++ b/code/modules/recycling/disposal/construction.dm @@ -17,7 +17,7 @@ . = ..() if(isnull(.)) return - density = anchorvalue ? initial(pipe_type.density) : FALSE + set_density(anchorvalue ? initial(pipe_type.density) : FALSE) /obj/structure/disposalconstruct/Initialize(mapload, _pipe_type, _dir = SOUTH, flip = FALSE, obj/make_from) . = ..() diff --git a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm index 6aa7f31e88d..d9771c6a3ec 100644 --- a/code/modules/ruins/objects_and_mobs/necropolis_gate.dm +++ b/code/modules/ruins/objects_and_mobs/necropolis_gate.dm @@ -112,7 +112,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) @@ -136,7 +136,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/spells/spell.dm b/code/modules/spells/spell.dm index 614aee3fa77..a4ebda1cab2 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -341,7 +341,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th spell.icon = overlay_icon spell.icon_state = overlay_icon_state spell.set_anchored(TRUE) - spell.density = FALSE + spell.set_density(FALSE) QDEL_IN(spell, overlay_lifespan) /obj/effect/proc_holder/spell/proc/after_cast(list/targets) diff --git a/code/modules/spells/spell_types/projectile.dm b/code/modules/spells/spell_types/projectile.dm index a929bbf20d0..3f458273ea9 100644 --- a/code/modules/spells/spell_types/projectile.dm +++ b/code/modules/spells/spell_types/projectile.dm @@ -36,7 +36,7 @@ trail.icon = trail_icon trail.icon_state = trail_icon_state //might be changed to temp overlay - trail.density = FALSE + trail.set_density(FALSE) trail.mouse_opacity = MOUSE_OPACITY_TRANSPARENT QDEL_IN(trail, trail_lifespan) diff --git a/code/modules/vehicles/mecha/mecha_construction_paths.dm b/code/modules/vehicles/mecha/mecha_construction_paths.dm index b28ff4ff008..83c8b2acc67 100644 --- a/code/modules/vehicles/mecha/mecha_construction_paths.dm +++ b/code/modules/vehicles/mecha/mecha_construction_paths.dm @@ -66,7 +66,7 @@ /datum/component/construction/unordered/mecha_chassis/spawn_result() var/atom/parent_atom = parent parent_atom.icon = 'icons/mecha/mech_construction.dmi' - parent_atom.density = TRUE + parent_atom.set_density(TRUE) parent_atom.cut_overlays() ..() diff --git a/code/modules/vehicles/motorized_wheelchair.dm b/code/modules/vehicles/motorized_wheelchair.dm index 00225b27a4c..32dd8e2de0a 100644 --- a/code/modules/vehicles/motorized_wheelchair.dm +++ b/code/modules/vehicles/motorized_wheelchair.dm @@ -62,11 +62,11 @@ /obj/vehicle/ridden/wheelchair/motorized/post_buckle_mob(mob/living/user) . = ..() - density = TRUE + set_density(TRUE) /obj/vehicle/ridden/wheelchair/motorized/post_unbuckle_mob() . = ..() - density = FALSE + set_density(FALSE) /obj/vehicle/ridden/wheelchair/motorized/attack_hand(mob/living/user, list/modifiers) if(!power_cell || !panel_open) diff --git a/code/modules/vehicles/scooter.dm b/code/modules/vehicles/scooter.dm index 5c64547ffd2..4e238b58860 100644 --- a/code/modules/vehicles/scooter.dm +++ b/code/modules/vehicles/scooter.dm @@ -74,12 +74,12 @@ initialize_controller_action_type(/datum/action/vehicle/ridden/scooter/skateboard/ollie, VEHICLE_CONTROL_DRIVE) /obj/vehicle/ridden/scooter/skateboard/post_buckle_mob(mob/living/M)//allows skateboards to be non-dense but still allows 2 skateboarders to collide with each other - density = TRUE + set_density(TRUE) return ..() /obj/vehicle/ridden/scooter/skateboard/post_unbuckle_mob(mob/living/M) if(!has_buckled_mobs()) - density = FALSE + set_density(FALSE) return ..() /obj/vehicle/ridden/scooter/skateboard/Bump(atom/A)