diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm index 93ea9ee2cb..277a668442 100644 --- a/code/_helpers/unsorted.dm +++ b/code/_helpers/unsorted.dm @@ -840,7 +840,11 @@ Turf and target are seperate in case you want to teleport some distance from a t //Move the objects. Not forceMove because the object isn't "moving" really, it's supposed to be on the "same" turf. for(var/obj/O in T) O.loc = X - O.update_light() + if(O.light_system == STATIC_LIGHT) + O.update_light() + else + var/datum/component/overlay_lighting/OL = O.GetComponent(/datum/component/overlay_lighting) + OL?.on_parent_moved(O, T, O.dir, TRUE) if(z_level_change) // The objects still need to know if their z-level changed. O.onTransitZ(T.z, X.z) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 1b47513e1b..d443b0bf0a 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -378,6 +378,7 @@ /atom/movable/proc/onTransitZ(old_z,new_z) GLOB.z_moved_event.raise_event(src, old_z, new_z) + SEND_SIGNAL(src, COMSIG_MOVABLE_Z_CHANGED, old_z, new_z) for(var/item in src) // Notify contents of Z-transition. This can be overridden IF we know the items contents do not care. var/atom/movable/AM = item AM.onTransitZ(old_z,new_z) diff --git a/code/game/objects/items/uav.dm b/code/game/objects/items/uav.dm index ddd4bcda09..cd23ffc624 100644 --- a/code/game/objects/items/uav.dm +++ b/code/game/objects/items/uav.dm @@ -97,8 +97,10 @@ return // Can disasemble or reassemble from packed or off (and this one takes time) if("(Dis)Assemble") - if(can_transition_to(state == UAV_PACKED ? UAV_OFF : UAV_PACKED, user) && do_after(user, 10 SECONDS, src)) - return toggle_packed(user) + if(can_transition_to(state == UAV_PACKED ? UAV_OFF : UAV_PACKED, user)) + user.visible_message("[user] starts [state == UAV_PACKED ? "unpacking" : "packing"] [src].", "You start [state == UAV_PACKED ? "unpacking" : "packing"] [src].") + if(do_after(user, 10 SECONDS, src)) + return toggle_packed(user) // Can toggle power from on and off if("Toggle Power") if(can_transition_to(state == UAV_ON ? UAV_OFF : UAV_ON, user)) diff --git a/code/modules/tgui/modules/ntos-only/uav.dm b/code/modules/tgui/modules/ntos-only/uav.dm index f27a08eda9..b9288457e5 100644 --- a/code/modules/tgui/modules/ntos-only/uav.dm +++ b/code/modules/tgui/modules/ntos-only/uav.dm @@ -13,11 +13,11 @@ if(current_uav) if(QDELETED(current_uav)) - set_current(null) + clear_current() else if(signal_test_counter-- <= 0) signal_strength = get_signal_to(current_uav) if(!signal_strength) - set_current(null) + clear_current() else // Don't reset counter until we find a UAV that's actually in range we can stay connected to signal_test_counter = 20 @@ -95,16 +95,33 @@ signal_strength = 0 current_uav = U + RegisterSignal(U, COMSIG_MOVABLE_Z_CHANGED, .proc/current_uav_changed_z) if(LAZYLEN(viewers)) for(var/weakref/W in viewers) var/M = W.resolve() if(M) - if(current_uav) - to_chat(M, "You're disconnected from the UAV's camera!") - unlook(M) - else - look(M) + look(M) + +/datum/tgui_module/uav/proc/clear_current() + if(!current_uav) + return + + UnregisterSignal(current_uav, COMSIG_MOVABLE_Z_CHANGED) + signal_strength = 0 + current_uav = null + + if(LAZYLEN(viewers)) + for(var/weakref/W in viewers) + var/M = W.resolve() + if(M) + to_chat(M, "You're disconnected from the UAV's camera!") + unlook(M) + +/datum/tgui_module/uav/proc/current_uav_changed_z(old_z, new_z) + signal_strength = get_signal_to(current_uav) + if(!signal_strength) + clear_current() //// //// Finding signal strength between us and the UAV @@ -130,6 +147,7 @@ var/list/zlevels_in_range = using_map.get_map_levels(their_z, FALSE) var/list/zlevels_in_long_range = using_map.get_map_levels(their_z, TRUE, om_range = DEFAULT_OVERMAP_RANGE) - zlevels_in_range var/their_signal = 0 + // Measure z-distance between the AM passed in and the nearest relay for(var/relay in ntnet_global.relays) var/obj/machinery/ntnet_relay/R = relay if(!R.operable()) @@ -144,7 +162,8 @@ their_signal = 1 break - if(!their_signal) //They have no NTnet at all + // AM passed in has no NTnet at all + if(!their_signal) if(get_z(host) == their_z && (get_dist(host, AM) < adhoc_range)) return 1 //We can connect (with weak signal) in same z without ntnet, within 30 turfs else