diff --git a/code/game/objects/items/devices/radio_jammer.dm b/code/game/objects/items/devices/radio_jammer.dm index 59f2aa7193a..07673cb66d3 100644 --- a/code/game/objects/items/devices/radio_jammer.dm +++ b/code/game/objects/items/devices/radio_jammer.dm @@ -131,6 +131,7 @@ var/list/active_radio_jammers = list() if (W.isscrewdriver()) to_chat(user, "You disassemble the improvised signal jammer.") user.put_in_hands(assembly_holder) + assembly_holder.detached() user.put_in_hands(cell) qdel(src) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 292bc5cee15..90907738d6c 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -228,6 +228,7 @@ set_dir(turn(dir, 90)) update_icon() + return TRUE /obj/AltClick(var/mob/user) if(obj_flags & OBJ_FLAG_ROTATABLE) diff --git a/code/modules/assembly/bomb.dm b/code/modules/assembly/bomb.dm index aa4df9c2836..e63d9554ef4 100644 --- a/code/modules/assembly/bomb.dm +++ b/code/modules/assembly/bomb.dm @@ -30,6 +30,7 @@ to_chat(user, SPAN_NOTICE("You disassemble \the [src].")) bombassembly.forceMove(get_turf(user)) + bombassembly.detached() bombassembly.master = null bombassembly = null diff --git a/code/modules/assembly/holder.dm b/code/modules/assembly/holder.dm index 027f38da0e1..b7a0c50073e 100644 --- a/code/modules/assembly/holder.dm +++ b/code/modules/assembly/holder.dm @@ -15,6 +15,10 @@ var/obj/special_assembly = null /obj/item/device/assembly_holder/proc/detached() + if(a_left) + a_left.holder_movement() + if(a_right) + a_right.holder_movement() return /obj/item/device/assembly_holder/IsAssemblyHolder() diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index c34fdc5b4a2..6f433b40bdc 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -7,13 +7,13 @@ origin_tech = list(TECH_MAGNET = 2) matter = list(DEFAULT_WALL_MATERIAL = 1000, MATERIAL_GLASS = 500) - wires = WIRE_PULSE secured = FALSE obj_flags = OBJ_FLAG_ROTATABLE var/on = FALSE var/visible = FALSE var/obj/effect/beam/i_beam/first = null + var/turf/beam_origin //If we're not on this turf anymore, we've moved. Catches holder.master movements when we're attached to bombs and stuff. /obj/item/device/assembly/infra/activate() if(!..()) @@ -53,12 +53,19 @@ holder.update_icon() /obj/item/device/assembly/infra/rotate(var/mob/user, var/anchored_ignore = FALSE) + if(..()) + var/direction_text = dir2text(dir) + to_chat(user, SPAN_NOTICE("You rotate \the [src] to face [direction_text].")) + QDEL_NULL(first) + +/obj/item/device/assembly/infra/examine(mob/user) . = ..() var/direction_text = dir2text(dir) - to_chat(user, SPAN_NOTICE("You rotate \the [src] to face [direction_text].")) - QDEL_NULL(first) + to_chat(user, SPAN_NOTICE("It is facing [direction_text].")) + /obj/item/device/assembly/infra/process() + if(!on || !secured) QDEL_NULL(first) return ..() @@ -66,8 +73,16 @@ if(first && !isturf(first.loc)) QDEL_NULL(first) - if(!first && (isturf(loc) || (holder && isturf(holder.loc)))) - var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(holder ? holder.loc : loc, src) + //We have no infrared beam, so create one. + if(!first) + //We cannot create beams while being held or in a bag. So we have to compare locs to turfs. + //We need to check if whatever we're attached to, if anything, is on a turf. Since we can be attached to an assembly and that assembly can be attached, we have to check a couple locs. + //First check if we're part of an assembly(holder) and if that assembly is attached (holder.master). If we are, THOSE are the locs we care about. + var/true_location = holder ? holder.master ? holder.master.loc : holder.loc : loc + if(!isturf(true_location)) //Wherever we are, we're not on a turf, nor is our assembly, nor is our bomb/whatever the assembly is attached to. We cannot make a beam. + return + beam_origin = true_location + var/obj/effect/beam/i_beam/I = new /obj/effect/beam/i_beam(true_location, src) I.density = TRUE step(I, I.dir) if(I) @@ -79,6 +94,10 @@ return if(first) + if(beam_origin != get_turf(src)) //If the assembly we're attached to has moved, delete the beam. + QDEL_NULL(first) + beam_origin = null + return first.process() diff --git a/code/modules/reagents/reagent_dispenser.dm b/code/modules/reagents/reagent_dispenser.dm index 4b1c6028e6b..5752e0e6e20 100644 --- a/code/modules/reagents/reagent_dispenser.dm +++ b/code/modules/reagents/reagent_dispenser.dm @@ -151,6 +151,7 @@ user.visible_message(SPAN_WARNING("\The [user] carefully removes \the [rig] from \the [src]."), \ SPAN_NOTICE("You carefully remove \the [rig] from \the [src].")) rig.forceMove(get_turf(user)) + rig.detached() user.put_in_hands(rig) rig = null overlays = new/list() diff --git a/html/changelogs/doxxmedearly - infrared_fixes.yml b/html/changelogs/doxxmedearly - infrared_fixes.yml new file mode 100644 index 00000000000..37ba90cdf77 --- /dev/null +++ b/html/changelogs/doxxmedearly - infrared_fixes.yml @@ -0,0 +1,7 @@ +author: Doxxmedearly + +delete-after: True + +changes: + - bugfix: "Infrared sensors now properly emit their beam when attached to a device, such as a bomb. Signalers can now activate infrared sensors." + - bugfix: "Fixed several instances where infrared beams would linger despite the sensor being moved or manipulated." \ No newline at end of file