Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MIRROR] Scopes NODECONSTRUCT_1 from flags_1 to obj_flags #1045

Merged
merged 1 commit into from
Dec 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions code/__DEFINES/_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,45 +17,43 @@ GLOBAL_LIST_INIT(bitflags, list(1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 204

/// Is this object currently processing in the atmos object list?
#define ATMOS_IS_PROCESSING_1 (1<<0)
/// For machines and structures that should not break into parts, eg, holodeck stuff
#define NODECONSTRUCT_1 (1<<1)
/// item has priority to check when entering or leaving
#define ON_BORDER_1 (1<<2)
#define ON_BORDER_1 (1<<1)
///Whether or not this atom shows screentips when hovered over
#define NO_SCREENTIPS_1 (1<<3)
#define NO_SCREENTIPS_1 (1<<2)
/// Prevent clicking things below it on the same turf eg. doors/ fulltile windows
#define PREVENT_CLICK_UNDER_1 (1<<4)
#define PREVENT_CLICK_UNDER_1 (1<<3)
///specifies that this atom is a hologram that isnt real
#define HOLOGRAM_1 (1<<5)
#define HOLOGRAM_1 (1<<4)
///Whether /atom/Initialize() has already run for the object
#define INITIALIZED_1 (1<<6)
#define INITIALIZED_1 (1<<5)
/// was this spawned by an admin? used for stat tracking stuff.
#define ADMIN_SPAWNED_1 (1<<7)
#define ADMIN_SPAWNED_1 (1<<6)
/// should not get harmed if this gets caught by an explosion?
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<8)
#define PREVENT_CONTENTS_EXPLOSION_1 (1<<7)
/// Should this object be paintable with very dark colors?
#define ALLOW_DARK_PAINTS_1 (1<<9)
#define ALLOW_DARK_PAINTS_1 (1<<8)
/// Should this object be unpaintable?
#define UNPAINTABLE_1 (1<<10)
#define UNPAINTABLE_1 (1<<9)
/// Is this atom on top of another atom, and as such has click priority?
#define IS_ONTOP_1 (1<<11)
#define IS_ONTOP_1 (1<<10)
/// Is this atom immune to being dusted by the supermatter?
#define SUPERMATTER_IGNORES_1 (1<<12)
#define SUPERMATTER_IGNORES_1 (1<<11)
/// If a turf can be made dirty at roundstart. This is also used in areas.
#define CAN_BE_DIRTY_1 (1<<13)
#define CAN_BE_DIRTY_1 (1<<12)
/// Should we use the initial icon for display? Mostly used by overlay only objects
#define HTML_USE_INITAL_ICON_1 (1<<14)
#define HTML_USE_INITAL_ICON_1 (1<<13)
/// Can players recolor this in-game via vendors (and maybe more if support is added)?
#define IS_PLAYER_COLORABLE_1 (1<<15)
#define IS_PLAYER_COLORABLE_1 (1<<14)
/// Whether or not this atom has contextual screentips when hovered OVER
#define HAS_CONTEXTUAL_SCREENTIPS_1 (1<<16)
#define HAS_CONTEXTUAL_SCREENTIPS_1 (1<<15)
/// Whether or not this atom is storing contents for a disassociated storage object
#define HAS_DISASSOCIATED_STORAGE_1 (1<<17)
#define HAS_DISASSOCIATED_STORAGE_1 (1<<16)
/// If this atom has experienced a decal element "init finished" sourced appearance update
/// We use this to ensure stacked decals don't double up appearance updates for no rasin
/// Flag as an optimization, don't make this a trait without profiling
/// Yes I know this is a stupid flag, no you can't take him from me
#define DECAL_INIT_UPDATE_EXPERIENCED_1 (1<<18)
#define DECAL_INIT_UPDATE_EXPERIENCED_1 (1<<17)

// Update flags for [/atom/proc/update_appearance]
/// Update the atom's name
Expand Down
1 change: 1 addition & 0 deletions code/__DEFINES/obj_flags.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define IGNORE_DENSITY (1<<11) //! Can we ignore density when building on this object? (for example, directional windows and grilles)
#define INFINITE_RESKIN (1<<12) // We can reskin this item infinitely
#define CONDUCTS_ELECTRICITY (1<<13) //! Can this object conduct electricity?
#define NO_DECONSTRUCTION (1<<14) //! Prevent deconstruction of this object.

// If you add new ones, be sure to add them to /obj/Initialize as well for complete mapping support

Expand Down
4 changes: 1 addition & 3 deletions code/_globalvars/bitfields.dm
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,6 @@ DEFINE_BITFIELD(flags_1, list(
"IS_ONTOP_1" = IS_ONTOP_1,
"IS_PLAYER_COLORABLE_1" = IS_PLAYER_COLORABLE_1,
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
"NO_SCREENTIPS_1" = NO_SCREENTIPS_1,
"NODECONSTRUCT_1" = NODECONSTRUCT_1,
"ON_BORDER_1" = ON_BORDER_1,
"PREVENT_CLICK_UNDER_1" = PREVENT_CLICK_UNDER_1,
"PREVENT_CONTENTS_EXPLOSION_1" = PREVENT_CONTENTS_EXPLOSION_1,
Expand Down Expand Up @@ -299,6 +296,7 @@ DEFINE_BITFIELD(obj_flags, list(
"EMAGGED" = EMAGGED,
"IGNORE_DENSITY" = IGNORE_DENSITY,
"IN_USE" = IN_USE,
"NO_DECONSTRUCTION" = NO_DECONSTRUCTION,
"UNIQUE_RENAME" = UNIQUE_RENAME,
))

Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/frozen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ GLOBAL_LIST_INIT(freon_color_matrix, list("#2E5E69", "#60A2A8", "#A1AFB1", rgb(0
SIGNAL_HANDLER
var/obj/obj_target = target
obj_target.visible_message(span_danger("[obj_target] shatters into a million pieces!"))
obj_target.flags_1 |= NODECONSTRUCT_1 // disable item spawning
obj_target.obj_flags |= NO_DECONSTRUCTION // disable item spawning
obj_target.deconstruct(FALSE) // call pre-deletion specialized code -- internals release gas etc

/// signal handler for COMSIG_MOVABLE_MOVED that unfreezes our target if it moves onto an open turf thats hotter than
Expand Down
2 changes: 1 addition & 1 deletion code/datums/elements/screentips/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Example:

```dm
/obj/structure/table/Initialize(mapload)
if (!(flags_1 & NODECONSTRUCT_1))
if (!(obj_flags & NO_DECONSTRUCTION))
var/static/list/tool_behaviors = list(
TOOL_SCREWDRIVER = list(
SCREENTIP_CONTEXT_RMB = "Disassemble",
Expand Down
12 changes: 6 additions & 6 deletions code/game/machinery/_machinery.dm
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@
SEND_SIGNAL(src, COMSIG_MACHINERY_REFRESH_PARTS)

/obj/machinery/proc/default_pry_open(obj/item/crowbar, close_after_pry = FALSE, open_density = FALSE, closed_density = TRUE)
. = !(state_open || panel_open || is_operational || (flags_1 & NODECONSTRUCT_1)) && crowbar.tool_behaviour == TOOL_CROWBAR
. = !(state_open || panel_open || is_operational || (obj_flags & NO_DECONSTRUCTION)) && crowbar.tool_behaviour == TOOL_CROWBAR
if(!.)
return
crowbar.play_tool_sound(src, 50)
Expand All @@ -809,14 +809,14 @@
close_machine(density_to_set = closed_density)

/obj/machinery/proc/default_deconstruction_crowbar(obj/item/crowbar, ignore_panel = 0, custom_deconstruct = FALSE)
. = (panel_open || ignore_panel) && !(flags_1 & NODECONSTRUCT_1) && crowbar.tool_behaviour == TOOL_CROWBAR
. = (panel_open || ignore_panel) && !(obj_flags & NO_DECONSTRUCTION) && crowbar.tool_behaviour == TOOL_CROWBAR
if(!. || custom_deconstruct)
return
crowbar.play_tool_sound(src, 50)
deconstruct(TRUE)

/obj/machinery/deconstruct(disassembled = TRUE)
if(flags_1 & NODECONSTRUCT_1)
if(obj_flags & NO_DECONSTRUCTION)
return ..() //Just delete us, no need to call anything else.

on_deconstruction()
Expand Down Expand Up @@ -874,7 +874,7 @@

/obj/machinery/atom_break(damage_flag)
. = ..()
if(!(machine_stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
if(!(machine_stat & BROKEN) && !(obj_flags & NO_DECONSTRUCTION))
set_machine_stat(machine_stat | BROKEN)
SEND_SIGNAL(src, COMSIG_MACHINERY_BROKEN, damage_flag)
update_appearance()
Expand Down Expand Up @@ -921,7 +921,7 @@
qdel(atom_part)

/obj/machinery/proc/default_deconstruction_screwdriver(mob/user, icon_state_open, icon_state_closed, obj/item/screwdriver)
if((flags_1 & NODECONSTRUCT_1) || screwdriver.tool_behaviour != TOOL_SCREWDRIVER)
if((obj_flags & NO_DECONSTRUCTION) || screwdriver.tool_behaviour != TOOL_SCREWDRIVER)
return FALSE

screwdriver.play_tool_sound(src, 50)
Expand All @@ -948,7 +948,7 @@
if(!istype(replacer_tool))
return FALSE

if((flags_1 & NODECONSTRUCT_1) && !replacer_tool.works_from_distance)
if((obj_flags & NO_DECONSTRUCTION) && !replacer_tool.works_from_distance)
return FALSE

var/shouldplaysound = FALSE
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/barsigns.dm
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/barsign, 32)

/obj/machinery/barsign/atom_break(damage_flag)
. = ..()
if((machine_stat & BROKEN) && !(flags_1 & NODECONSTRUCT_1))
if((machine_stat & BROKEN) && !(obj_flags & NO_DECONSTRUCTION))
set_sign(new /datum/barsign/hiddensigns/signoff)

/obj/machinery/barsign/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
if(disassembled)
new disassemble_result(drop_location())
else
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/camera/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/camera/xray, 0)
toggle_cam(null, 0)

/obj/machinery/camera/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
if(disassembled)
var/obj/structure/camera_assembly/assembly = assembly_ref?.resolve()
if(!assembly)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/camera/camera_assembly.dm
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@


/obj/structure/camera_assembly/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc)
qdel(src)

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/computer/_computer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
/obj/machinery/computer/screwdriver_act(mob/living/user, obj/item/I)
if(..())
return TRUE
if(circuit && !(flags_1&NODECONSTRUCT_1))
if(circuit && !(obj_flags & NO_DECONSTRUCTION))
to_chat(user, span_notice("You start to disconnect the monitor..."))
if(I.use_tool(src, user, time_to_unscrew, volume=50))
deconstruct(TRUE, user)
Expand Down Expand Up @@ -100,7 +100,7 @@

/obj/machinery/computer/deconstruct(disassembled = TRUE, mob/user)
on_deconstruction()
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
if(circuit) //no circuit, no computer frame
var/obj/structure/frame/computer/A = new /obj/structure/frame/computer(src.loc)
A.setDir(dir)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
return TOOL_ACT_TOOLTYPE_SUCCESS

/obj/item/air_sensor/deconstruct(disassembled)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/analyzer(loc)
new /obj/item/stack/sheet/iron(loc, 1)
return ..()
2 changes: 1 addition & 1 deletion code/game/machinery/computer/buildandrepair.dm
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@
return ..() // This hotkey is BLACKLISTED since it's used by /datum/component/simple_rotation

/obj/structure/frame/computer/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
if(state == 4)
new /obj/item/shard(drop_location())
new /obj/item/shard(drop_location())
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/computer/telescreen.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
pixel_shift = 32

/obj/machinery/computer/security/telescreen/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
new frame_type(loc)
qdel(src)

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/constructable_frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


/obj/structure/frame/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 5)
if(circuit)
circuit.forceMove(loc)
Expand Down Expand Up @@ -410,7 +410,7 @@
return part

/obj/structure/frame/machine/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
if(state >= 2)
new /obj/item/stack/cable_coil(loc , 5)

Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/dance_machine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
req_access = null
anchored = TRUE
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
flags_1 = NODECONSTRUCT_1
obj_flags = NO_DECONSTRUCTION

/datum/track
var/song_name = "generic"
Expand Down Expand Up @@ -92,7 +92,7 @@
return ..()

/obj/machinery/jukebox/attackby(obj/item/O, mob/user, params)
if(!active && !(flags_1 & NODECONSTRUCT_1))
if(!active && !(obj_flags & NO_DECONSTRUCTION))
if(O.tool_behaviour == TOOL_WRENCH)
if(!anchored && !isinspace())
to_chat(user,span_notice("You secure [src] to the floor."))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/deployable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
var/bar_material = METAL

/obj/structure/barricade/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
make_debris()
qdel(src)

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/digital_clock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
emag_act()

/obj/machinery/digital_clock/deconstruct(disassembled = TRUE)
if(flags_1 & NODECONSTRUCT_1)
if(obj_flags & NO_DECONSTRUCTION)
return
if(disassembled)
new /obj/item/wallframe/digital_clock(drop_location())
Expand Down
4 changes: 2 additions & 2 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1515,7 +1515,7 @@

/obj/machinery/door/airlock/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1, attack_dir)
if((damage_amount >= atom_integrity) && (damage_flag == BOMB))
flags_1 |= NODECONSTRUCT_1 //If an explosive took us out, don't drop the assembly
obj_flags |= NO_DECONSTRUCTION //If an explosive took us out, don't drop the assembly
. = ..()
if(atom_integrity < (0.75 * max_integrity))
update_appearance()
Expand All @@ -1531,7 +1531,7 @@
assembly.update_appearance()

/obj/machinery/door/airlock/deconstruct(disassembled = TRUE, mob/user)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
var/obj/structure/door_assembly/A
if(assemblytype)
A = new assemblytype(loc)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/doors/firedoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@
correct_state() //So we should re-evaluate our state

/obj/machinery/door/firedoor/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
var/turf/targetloc = get_turf(src)
if(disassembled || prob(40))
var/obj/structure/firelock_frame/unbuilt_lock = new assemblytype(targetloc)
Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/doors/windowdoor.dm
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@


/obj/machinery/door/window/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1) && !disassembled)
if(!(obj_flags & NO_DECONSTRUCTION) && !disassembled)
for(var/i in 1 to shards)
drop_debris(new /obj/item/shard(src))
if(rods)
Expand Down Expand Up @@ -346,7 +346,7 @@

/obj/machinery/door/window/screwdriver_act(mob/living/user, obj/item/tool)
. = ..()
if(flags_1 & NODECONSTRUCT_1)
if(obj_flags & NO_DECONSTRUCTION)
return
if(density || operating)
to_chat(user, span_warning("You need to open the door to access the maintenance panel!"))
Expand All @@ -359,7 +359,7 @@

/obj/machinery/door/window/crowbar_act(mob/living/user, obj/item/tool)
. = ..()
if(flags_1 & NODECONSTRUCT_1)
if(obj_flags & NO_DECONSTRUCTION)
return
if(!panel_open || density || operating)
return
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/droneDispenser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@
playsound(src, break_sound, 50, TRUE)

/obj/machinery/drone_dispenser/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 5)
qdel(src)

Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/firealarm.dm
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@
return ..()

/obj/machinery/firealarm/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
new /obj/item/stack/sheet/iron(loc, 1)
if(buildstage > FIRE_ALARM_BUILD_NO_CIRCUIT)
var/obj/item/item = new /obj/item/electronics/firealarm(loc)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/flasher.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ MAPPING_DIRECTIONAL_HELPERS(/obj/machinery/flasher, 26)
power_change()

/obj/machinery/flasher/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
if(!(obj_flags & NO_DECONSTRUCTION))
if(bulb)
bulb.forceMove(loc)
if(disassembled)
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/harvester.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@
return TRUE

/obj/machinery/harvester/default_pry_open(obj/item/tool) //wew
. = !(state_open || panel_open || (flags_1 & NODECONSTRUCT_1)) && tool.tool_behaviour == TOOL_CROWBAR //We removed is_operational here
. = !(state_open || panel_open || (obj_flags & NO_DECONSTRUCTION)) && tool.tool_behaviour == TOOL_CROWBAR //We removed is_operational here
if(.)
tool.play_tool_sound(src, 50)
visible_message(span_notice("[usr] pries open \the [src]."), span_notice("You pry open [src]."))
Expand Down
2 changes: 1 addition & 1 deletion code/game/machinery/hologram.dm
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ Possible to do for anyone motivated enough:

/obj/machinery/holopad/tutorial
resistance_flags = INDESTRUCTIBLE | LAVA_PROOF | FIRE_PROOF | UNACIDABLE | ACID_PROOF
flags_1 = NODECONSTRUCT_1
obj_flags = NO_DECONSTRUCTION
on_network = FALSE
///Proximity monitor associated with this atom, needed for proximity checks.
var/datum/proximity_monitor/proximity_monitor
Expand Down
Loading
Loading