Skip to content

Commit

Permalink
Disambiguating status setter procs.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jan 28, 2025
1 parent 63a2108 commit ac06263
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion code/datums/wires/camera.dm
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ var/global/const/CAMERA_WIRE_ALARM = 8

if(CAMERA_WIRE_POWER)
C.cut_power = !mended
C.set_status_condition(mended, usr)
C.set_camera_status(mended, usr)

if(CAMERA_WIRE_LIGHT)
C.light_disabled = !mended
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
if(istype(machine))
machine.power_change()
machine.queue_icon_update()
set_status_condition(machine, PART_STAT_CONNECTED)
set_component_status(machine, PART_STAT_CONNECTED)
update_icon()
return cell

Expand Down Expand Up @@ -112,7 +112,7 @@
/obj/item/stock_parts/power/battery/can_provide_power(var/obj/machinery/machine)
if(is_functional() && cell && cell.check_charge(CELLRATE * machine.get_power_usage()))
machine.update_power_channel(LOCAL)
set_status_condition(machine, PART_STAT_ACTIVE)
set_component_status(machine, PART_STAT_ACTIVE)
return TRUE
return FALSE

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
//Is willing to provide power if the wired contribution is nonnegligible and there is enough total local power to run the machine.
/obj/item/stock_parts/power/terminal/can_provide_power(var/obj/machinery/machine)
if(is_functional() && terminal && terminal.surplus() && machine.can_use_power_oneoff(machine.get_power_usage(), LOCAL) <= 0)
set_status_condition(machine, PART_STAT_ACTIVE)
set_component_status(machine, PART_STAT_ACTIVE)
machine.update_power_channel(LOCAL)
return TRUE
return FALSE
Expand Down Expand Up @@ -76,7 +76,7 @@
terminal.queue_icon_update()

set_extension(src, /datum/extension/event_registration/shuttle_stationary, GET_DECL(/decl/observ/moved), machine, PROC_REF(machine_moved), get_area(src))
set_status_condition(machine, PART_STAT_CONNECTED)
set_component_status(machine, PART_STAT_CONNECTED)
start_processing(machine)

/obj/item/stock_parts/power/terminal/proc/machine_moved(var/obj/machinery/machine, var/turf/old_loc, var/turf/new_loc)
Expand Down
4 changes: 2 additions & 2 deletions code/modules/clothing/spacesuits/spacesuits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@

if(ispath(camera))
camera = new camera(src)
camera.set_status_condition(0)
camera.set_camera_status(0)

if(camera)
camera.set_status_condition(!camera.status)
camera.set_camera_status(!camera.status)
if(camera.status)
camera.c_tag = user.get_id_name()
to_chat(user, "<span class='notice'>User scanned as [camera.c_tag]. Camera activated.</span>")
Expand Down
4 changes: 2 additions & 2 deletions code/modules/mob/living/bot/secbot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@

/mob/living/bot/secbot/turn_on()
..()
stun_baton.set_status_condition(on, null)
stun_baton.set_cell_status(on, null)

/mob/living/bot/secbot/turn_off()
..()
stun_baton.set_status_condition(on, null)
stun_baton.set_cell_status(on, null)

/mob/living/bot/secbot/on_update_icon()
..()
Expand Down
7 changes: 3 additions & 4 deletions code/modules/mob/living/silicon/pai/software.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,15 @@ var/global/list/default_pai_software = list()
/mob/living/silicon/pai/ui_interact(mob/user, ui_key = "main", datum/nanoui/ui = null, force_open = 1)

if(user != src || !istype(card))
if(ui)
ui.set_status_condition(STATUS_CLOSE, 0)
ui?.set_nano_status(STATUS_CLOSE, 0)
return

if(ui_key != "main")
var/datum/pai_software/S = software[ui_key]
if(S && !S.toggle)
S.on_ui_interact(src, ui, force_open)
else
if(ui) ui.set_status_condition(STATUS_CLOSE, 0)
else if(ui)
ui.set_nano_status(STATUS_CLOSE, 0)
return

var/data[0]
Expand Down
2 changes: 1 addition & 1 deletion code/modules/modular_computers/hardware/lan_port.dm
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
terminal = new(get_turf(parent))
set_extension(src, /datum/extension/event_registration/shuttle_stationary, GET_DECL(/decl/observ/moved), parent, PROC_REF(check_terminal_prox), get_area(src))
events_repository.register(/decl/observ/destroyed, terminal, src, PROC_REF(unset_terminal))
set_status_condition(parent, PART_STAT_CONNECTED)
set_component_status(parent, PART_STAT_CONNECTED)

/obj/item/stock_parts/computer/lan_port/proc/unset_terminal()
remove_extension(src, /datum/extension/event_registration/shuttle_stationary)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/status/effects/status_effect_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
. = TRUE
if(source)
return

// We didn't find one to remove. Tragic.
return FALSE

Expand All @@ -51,7 +52,7 @@
return FALSE
if(!source) // We don't care about specifics.
return TRUE
for(var/datum/status_effect/existing_effect in status_effects)
for(var/datum/status_effect/existing_effect in effect_data)
if(existing_effect.source?.resolve() == source)
return TRUE
return FALSE
Expand Down

0 comments on commit ac06263

Please sign in to comment.