From cc13c52fed6ab2ccff51fc16cbc6044677478794 Mon Sep 17 00:00:00 2001 From: benjicoots <11049499+benjicoots@users.noreply.github.com> Date: Sat, 12 Aug 2023 20:27:42 +0200 Subject: [PATCH] =?UTF-8?q?Make=20air=20alarms=20start=20with=20the=20corr?= =?UTF-8?q?ect=20default=20state=20when=20placing=20the=E2=80=A6=20(#21635?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Make air alarms start with the correct default state when placing the frame * Update code/game/objects/items/mountable_frames/air_alarm_frame.dm Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> * undefs to allow CI passing * define moment --------- Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: Luc <89928798+lewcc@users.noreply.github.com> --- code/__DEFINES/machines.dm | 4 ++++ .../objects/items/mountable_frames/air_alarm_frame.dm | 4 +++- code/modules/atmospherics/machinery/airalarm.dm | 9 --------- 3 files changed, 7 insertions(+), 10 deletions(-) diff --git a/code/__DEFINES/machines.dm b/code/__DEFINES/machines.dm index 121042e8024..77b25e56917 100644 --- a/code/__DEFINES/machines.dm +++ b/code/__DEFINES/machines.dm @@ -71,3 +71,7 @@ #define TURRET_PREASSESS_VALID 1 #define TURRET_PREASSESS_INVALID 0 + +#define AIR_ALARM_FRAME 0 +#define AIR_ALARM_UNWIRED 1 +#define AIR_ALARM_READY 2 diff --git a/code/game/objects/items/mountable_frames/air_alarm_frame.dm b/code/game/objects/items/mountable_frames/air_alarm_frame.dm index b0d3d1bc8e1..5f18c6ac25d 100644 --- a/code/game/objects/items/mountable_frames/air_alarm_frame.dm +++ b/code/game/objects/items/mountable_frames/air_alarm_frame.dm @@ -14,5 +14,7 @@ Code shamelessly copied from apc_frame mount_requirements = MOUNTED_FRAME_SIMFLOOR | MOUNTED_FRAME_NOSPACE /obj/item/mounted/frame/alarm_frame/do_build(turf/on_wall, mob/user) - new /obj/machinery/alarm(get_turf(src), get_dir(on_wall, user), 1) + var/obj/machinery/alarm/A = new/obj/machinery/alarm(get_turf(src), get_dir(on_wall, user), 1) + A.buildstage = AIR_ALARM_FRAME // Set the build stage to the initial state + A.update_icon() qdel(src) diff --git a/code/modules/atmospherics/machinery/airalarm.dm b/code/modules/atmospherics/machinery/airalarm.dm index 363f4571ed5..8839b87fb67 100644 --- a/code/modules/atmospherics/machinery/airalarm.dm +++ b/code/modules/atmospherics/machinery/airalarm.dm @@ -57,10 +57,6 @@ #define MAX_TEMPERATURE 363.15 // 90C #define MIN_TEMPERATURE 233.15 // -40C -#define AIR_ALARM_FRAME 0 -#define AIR_ALARM_UNWIRED 1 -#define AIR_ALARM_READY 2 - //all air alarms in area are connected via magic /area var/obj/machinery/alarm/master_air_alarm @@ -1176,8 +1172,3 @@ Just an object used in constructing air alarms origin_tech = "engineering=2;programming=1" toolspeed = 1 usesound = 'sound/items/deconstruct.ogg' - - -#undef AIR_ALARM_FRAME -#undef AIR_ALARM_UNWIRED -#undef AIR_ALARM_READY