Fixes bypassing integrated circuit cooldowns with module components. (#75581)

## About The Pull Request
See title.
In order for this change to work, these components will not work if
there is no shell, but this will change nothing user-facing because all
player-facing circuits require shells to function in the first place
anyways.

## Why It's Good For The Game
Fixes a cooldown bypass bug.

Closes #75580

## Changelog
🆑
fix: Fixed bypassing component cooldowns with module components.
/🆑

---------

Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
Watermelon914
2023-05-22 18:55:11 -06:00
committed by GitHub
co-authored by Watermelon914
parent 9ba051c857
commit 9fd0b4e770
4 changed files with 21 additions and 13 deletions
@@ -35,11 +35,14 @@
if(!bci)
return
if(!parent.shell)
return
var/mob/living/owner = bci.owner
if(!owner || !istype(owner) || !owner.client)
return
if(TIMER_COOLDOWN_CHECK(parent, COOLDOWN_CIRCUIT_TARGET_INTERCEPT))
if(TIMER_COOLDOWN_CHECK(parent.shell, COOLDOWN_CIRCUIT_TARGET_INTERCEPT))
return
to_chat(owner, "<B>Left-click to trigger target interceptor!</B>")
@@ -55,7 +58,8 @@
user.client.click_intercept = null
clicked_atom.set_output(object)
trigger_output.set_output(COMPONENT_SIGNAL)
TIMER_COOLDOWN_START(parent, COOLDOWN_CIRCUIT_TARGET_INTERCEPT, intercept_cooldown)
if(parent.shell)
TIMER_COOLDOWN_START(parent.shell, COOLDOWN_CIRCUIT_TARGET_INTERCEPT, intercept_cooldown)
/obj/item/circuit_component/target_intercept/get_ui_notices()
. = ..()