diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm index 66601e8a08..2eaa6d6711 100644 --- a/code/game/machinery/computer/medical.dm +++ b/code/game/machinery/computer/medical.dm @@ -300,13 +300,13 @@ screen = MED_DATA_RECORD if("sync_r") if(active2) - set_temp(client_update_record(src,usr)) + set_temp(client_update_record(src,ui.user)) if("edit_notes") // The modal input in tgui is busted for this sadly... - var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH) - if(usr.Adjacent(src)) - if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete") - if(usr.Adjacent(src)) + var/new_notes = strip_html_simple(tgui_input_text(ui.user,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH) + if(ui.user.Adjacent(src)) + if(new_notes != "" || tgui_alert(ui.user, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete") + if(ui.user.Adjacent(src)) active2.fields["notes"] = new_notes if("new") if(istype(active1, /datum/data/record) && !istype(active2, /datum/data/record)) diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm index 17f9619792..cf873879d0 100644 --- a/code/game/machinery/computer/security.dm +++ b/code/game/machinery/computer/security.dm @@ -272,13 +272,13 @@ qdel(active2) if("sync_r") if(active2) - set_temp(client_update_record(src,usr)) + set_temp(client_update_record(src,ui.user)) if("edit_notes") // The modal input in tgui is busted for this sadly... - var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH) - if(usr.Adjacent(src)) - if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete") - if(usr.Adjacent(src)) + var/new_notes = strip_html_simple(tgui_input_text(ui.user,"Enter new information here.","Character Preference", html_decode(active2.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH) + if(ui.user.Adjacent(src)) + if(new_notes != "" || tgui_alert(ui.user, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete") + if(ui.user.Adjacent(src)) active2.fields["notes"] = new_notes if("d_rec") var/datum/data/record/general_record = locate(params["d_rec"] || "") diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm index bac1fa7c9c..2a7a732087 100644 --- a/code/game/machinery/computer/skills.dm +++ b/code/game/machinery/computer/skills.dm @@ -216,13 +216,13 @@ set_temp("All employment records deleted.") if("sync_r") if(active1) - set_temp(client_update_record(src,active1,usr)) + set_temp(client_update_record(src,active1,ui.user)) if("edit_notes") // The modal input in tgui is busted for this sadly... - var/new_notes = strip_html_simple(tgui_input_text(usr,"Enter new information here.","Character Preference", html_decode(active1.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH) - if(usr.Adjacent(src)) - if(new_notes != "" || tgui_alert(usr, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete") - if(usr.Adjacent(src)) + var/new_notes = strip_html_simple(tgui_input_text(ui.user,"Enter new information here.","Character Preference", html_decode(active1.fields["notes"]), MAX_RECORD_LENGTH, TRUE, prevent_enter = TRUE), MAX_RECORD_LENGTH) + if(ui.user.Adjacent(src)) + if(new_notes != "" || tgui_alert(ui.user, "Are you sure you want to delete the current record's notes?", "Confirm Delete", list("Delete", "No")) == "Delete") + if(ui.user.Adjacent(src)) active1.fields["notes"] = new_notes if("del_r") if(PDA_Manifest) diff --git a/code/modules/power/lighting.dm b/code/modules/power/lighting.dm index f787b7bf7a..486ca493d0 100644 --- a/code/modules/power/lighting.dm +++ b/code/modules/power/lighting.dm @@ -748,19 +748,27 @@ var/global/list/light_type_cache = list() /obj/machinery/light/proc/flicker(var/amount = rand(10, 20)) if(flickering) return - flickering = 1 - spawn(0) - if(on && status == LIGHT_OK) - for(var/i = 0; i < amount; i++) - if(status != LIGHT_OK) break - on = !on - update(0) - if(!on) // Only play when the light turns off. - playsound(src, 'sound/effects/light_flicker.ogg', 50, 1) - sleep(rand(5, 15)) - on = (status == LIGHT_OK) - update(0) + if(on && status == LIGHT_OK) + flickering = 1 + do_flicker(amount) + +/obj/machinery/light/proc/do_flicker(remaining_flicks) + SHOULD_NOT_OVERRIDE(TRUE) + PRIVATE_PROC(TRUE) + if(status != LIGHT_OK) flickering = 0 + return + on = !on + update(0) + if(!on) // Only play when the light turns off. + playsound(src, 'sound/effects/light_flicker.ogg', 50, 1) + if(remaining_flicks > 0) + remaining_flicks-- + addtimer(CALLBACK(src, PROC_REF(do_flicker), remaining_flicks), rand(5, 15), TIMER_DELETE_ME) + return + on = (status == LIGHT_OK) + update(0) + flickering = 0 // ai attack - turn on/off emergency lighting for a specific fixture /obj/machinery/light/attack_ai(mob/user) diff --git a/code/modules/projectiles/guns/projectile/boltaction.dm b/code/modules/projectiles/guns/projectile/boltaction.dm index bcd74a99ef..4dafa60703 100644 --- a/code/modules/projectiles/guns/projectile/boltaction.dm +++ b/code/modules/projectiles/guns/projectile/boltaction.dm @@ -68,10 +68,10 @@ var/sawn_off = FALSE /obj/item/gun/projectile/shotgun/pump/rifle/ceremonial/attackby(var/obj/item/A as obj, mob/user as mob) - if(sawn_off) - to_chat(user, span_warning("The [src] is already shortened!")) - return if(istype(A, /obj/item/surgical/circular_saw) || istype(A, /obj/item/melee/energy) || istype(A, /obj/item/pickaxe/plasmacutter) && w_class != ITEMSIZE_NORMAL) + if(sawn_off) + to_chat(user, span_warning("The [src] is already shortened!")) + return to_chat(user, span_notice("You begin to shorten the barrel and stock of \the [src].")) if(loaded.len) afterattack(user, user)