General maintenance for mecha RCD (#88614)

## About The Pull Request
**1. Code Improvements**
 - Converted `rcd_range` from a var into a define to save memory
- Removed var `rcd_type` as it was redundant with the type of
`internal_rcd` var
- Moved attack chain code from `attackby()` to `interact_with_atom()`
when installing disk upgrade

**2. Fixes**
Fixes
https://github.com/tgstation/tgstation/pull/88589#issuecomment-2552405018,
https://github.com/tgstation/tgstation/pull/88589#issuecomment-2552294674.
i.e. the RCD cancels it's construction & deconstruction action if
   - The mech rotates away from where its building
   - The mech moves

## Changelog
🆑
code: improved code for mecha rcd
fix: mecha rcd will cancel its action when the mech is rotated or moves
during the action
/🆑
This commit is contained in:
SyncIt21
2024-12-21 22:28:31 +01:00
committed by GitHub
parent d0ba3918b8
commit bdca5fc2a3
3 changed files with 46 additions and 17 deletions
+12
View File
@@ -565,6 +565,18 @@
return owner.ui_status(user)
return UI_CLOSE
/obj/item/construction/rcd/exosuit/build_delay(mob/user, delay, atom/target)
if(delay <= 0)
return TRUE
var/obj/item/mecha_parts/mecha_equipment/rcd/module = loc
//deconstruction can't be cancelled by ui changes
if(mode != RCD_DECONSTRUCT)
blueprint_changed = FALSE
return module.do_after_mecha(target, user, delay)
/obj/item/construction/rcd/exosuit/get_matter(mob/user)
if(silo_link)
return ..()
+2
View File
@@ -63,6 +63,8 @@
return do_after(user, delay, target, extra_checks = CALLBACK(src, PROC_REF(blueprint_change)))
/obj/item/construction/proc/blueprint_change()
PRIVATE_PROC(TRUE)
return !blueprint_changed
///used for examining the RCD and for its UI