Skip to content

Commit

Permalink
Попытка разобраться с create_and_destroy, правка ударной установки
Browse files Browse the repository at this point in the history
  • Loading branch information
msw7007 committed Jul 15, 2024
1 parent aee4be2 commit 46c535f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion modular_bandastation/instruments/code/drumskit.dm
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,17 @@
song.allowed_instrument_ids = "drums"

/obj/structure/musician/drumskit/Destroy()
. = ..() // Пытаемся почистить треки
if (song)
qdel(song)
return ..()

/obj/structure/musician/drumskit/proc/start_playing()
SIGNAL_HANDLER
active = TRUE
update_icon(UPDATE_ICON_STATE)

/obj/structure/musician/drumskit/proc/stop_playing()
SIGNAL_HANDLER
active = FALSE
update_icon(UPDATE_ICON_STATE)

Expand All @@ -47,11 +48,14 @@
anchored = TRUE
can_buckle = TRUE
layer = 5
RegisterSignal(src, COMSIG_INSTRUMENT_START, PROC_REF(start_playing))
RegisterSignal(src, COMSIG_INSTRUMENT_END, PROC_REF(stop_playing))
else if(anchored)
to_chat(user, span_notice("You unsecure and disconnect [src]."))
anchored = FALSE
can_buckle = FALSE
layer = 2.5
UnregisterSignal(src, list(COMSIG_INSTRUMENT_START, COMSIG_INSTRUMENT_END, COMSIG_INSTRUMENT_SHOULD_STOP_PLAYING))

update_icon()
icon_state = "[base_icon_state][anchored ? null : "_unanchored"]"
Expand Down

0 comments on commit 46c535f

Please sign in to comment.