Merge pull request #2526 from CHOMPStationBot/upstream-merge-11043

[MIRROR] Make UAVs not work at impossible distances
This commit is contained in:
Nadyr
2021-07-13 22:53:27 -04:00
committed by GitHub
4 changed files with 37 additions and 11 deletions

View File

@@ -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)

View File

@@ -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("<b>[user]</b> 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))