From 32f2c62bc8ee3c25c21ab57ec656cc3511b27aa1 Mon Sep 17 00:00:00 2001 From: Mark Suckerberg Date: Wed, 11 Dec 2024 13:52:26 -0600 Subject: [PATCH] Fixes turrets again --- _maps/shuttles/inteq/inteq_colossus.dmm | 2 +- code/game/machinery/porta_turret/portable_turret.dm | 9 +++------ .../machinery/porta_turret/portable_turret_control.dm | 6 +++--- code/modules/unit_tests/ship_outpost_placement.dm | 2 +- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/_maps/shuttles/inteq/inteq_colossus.dmm b/_maps/shuttles/inteq/inteq_colossus.dmm index de835b016463..d1ce4fc6d8be 100644 --- a/_maps/shuttles/inteq/inteq_colossus.dmm +++ b/_maps/shuttles/inteq/inteq_colossus.dmm @@ -3949,7 +3949,7 @@ /area/ship/cargo) "RZ" = ( /obj/machinery/porta_turret/ship/inteq/light{ - id = "talos_grid"; + id = "colossus_grid"; dir = 6 }, /turf/closed/wall/mineral/plastitanium, diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index dc0c2d47f963..ea51bac01b50 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -151,7 +151,7 @@ return gun_properties /obj/machinery/porta_turret/connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) - id = "[text_ref(port)][initial(id)]" + id = "[text_ref(port)][id]" port.turret_list |= WEAKREF(src) /obj/machinery/porta_turret/proc/toggle_on(set_to) @@ -613,14 +613,11 @@ if(current_target) RegisterSignal(target, COMSIG_PARENT_QDELETING, PROC_REF(set_target)) -/obj/machinery/porta_turret/proc/set_state(on, new_mode, new_flags) - if(locked) - return - +/obj/machinery/porta_turret/proc/set_state(on, new_lethal, new_flags) if(!isnull(new_flags)) turret_flags = new_flags - lethal = new_mode + lethal = new_lethal toggle_on(on) power_change() diff --git a/code/game/machinery/porta_turret/portable_turret_control.dm b/code/game/machinery/porta_turret/portable_turret_control.dm index ba70fe3a44b1..b049fd3c7b95 100644 --- a/code/game/machinery/porta_turret/portable_turret_control.dm +++ b/code/game/machinery/porta_turret/portable_turret_control.dm @@ -47,13 +47,13 @@ /obj/machinery/turretid/proc/late_connect_to_shuttle(obj/docking_port/mobile/port, obj/docking_port/stationary/dock) SIGNAL_HANDLER - for(var/datum/weakref/ship_gun in port.turret_list) + for(var/datum/weakref/ship_gun as anything in port.turret_list) var/obj/machinery/porta_turret/turret_gun = ship_gun.resolve() //skip if it doesn't exist or if the id doesn't match if(turret_gun?.id != id) continue - turret_refs |= ship_gun + turret_refs += ship_gun update_turrets() UnregisterSignal(port, COMSIG_SHIP_DONE_CONNECTING) @@ -134,7 +134,7 @@ /obj/machinery/turretid/ui_act(action, list/params) . = ..() - if(.) + if(. || locked) return switch(action) diff --git a/code/modules/unit_tests/ship_outpost_placement.dm b/code/modules/unit_tests/ship_outpost_placement.dm index 0762af79e304..322474b80a0a 100644 --- a/code/modules/unit_tests/ship_outpost_placement.dm +++ b/code/modules/unit_tests/ship_outpost_placement.dm @@ -8,7 +8,7 @@ // they'll spawn in empty space, and won't be docked new /datum/overmap/ship/controlled(list("x" = 1, "y" = 1), map) catch(var/exception/e) - TEST_FAIL("Runtime error loading ship type ([map.name]): [e] on [e.file]:[e.line]\n[e.desc]") + Fail("Runtime error loading ship type ([map.name]): [e]\n[e.desc]", e.file, e.line) for(var/outpost_type in subtypesof(/datum/overmap/outpost)) var/datum/overmap/outpost/test_outpost = new outpost_type()