Skip to content

Commit

Permalink
Fixes turrets again
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkSuckerberg committed Dec 11, 2024
1 parent e0264c5 commit 32f2c62
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
2 changes: 1 addition & 1 deletion _maps/shuttles/inteq/inteq_colossus.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
9 changes: 3 additions & 6 deletions code/game/machinery/porta_turret/portable_turret.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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()

Expand Down
6 changes: 3 additions & 3 deletions code/game/machinery/porta_turret/portable_turret_control.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -134,7 +134,7 @@

/obj/machinery/turretid/ui_act(action, list/params)
. = ..()
if(.)
if(. || locked)
return

switch(action)
Expand Down
2 changes: 1 addition & 1 deletion code/modules/unit_tests/ship_outpost_placement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 32f2c62

Please sign in to comment.