fixes issues with the separate modsuit part activation (#87482)

## About The Pull Request

generally cleans up the code a bit. fixes the issue where if you had
clothing on yourself already and you tried extending when active it
still went through the sealing process even though it didnt extend the
part, causing weird desyncs. fixes the issues with part enabled modules
that would not activate, makes stealth and radproof modules require the
whole suit to be out cause thinking about it they wouldnt really work
without that i think
reverts quick activation to try put parts on you instead of removing
them as priority, i think that plays nicer with separate part activation

fixes #87413
This commit is contained in:
Fikou
2024-10-31 12:12:49 -05:00
committed by GitHub
parent 762a52ed83
commit 0f684bd7db
17 changed files with 225 additions and 244 deletions
+10 -5
View File
@@ -513,7 +513,7 @@
for(var/obj/item/part as anything in get_parts())
retract(null, part)
if(active)
finish_activation(is_on = FALSE)
control_activation(is_on = FALSE)
mod_link?.end_call()
var/mob/old_wearer = wearer
unset_wearer()
@@ -607,8 +607,9 @@
new_module.on_install()
if(wearer)
new_module.on_equip()
if(active && new_module.has_required_parts(mod_parts, need_extended = TRUE))
new_module.on_suit_activation()
if(active && new_module.has_required_parts(mod_parts, need_active = TRUE))
new_module.on_part_activation()
new_module.part_activated = TRUE
if(user)
balloon_alert(user, "[new_module] added")
playsound(src, 'sound/machines/click.ogg', 50, TRUE, SILENCED_SOUND_EXTRARANGE)
@@ -619,7 +620,7 @@
if(wearer)
old_module.on_unequip()
if(active)
old_module.on_suit_deactivation(deleting = deleting)
old_module.on_part_deactivation(deleting = deleting)
if(old_module.active)
old_module.deactivate(display_message = !deleting, deleting = deleting)
old_module.UnregisterSignal(src, COMSIG_ITEM_GET_WORN_OVERLAYS)
@@ -678,7 +679,7 @@
/obj/item/mod/control/proc/update_speed()
for(var/obj/item/part as anything in get_parts(all = TRUE))
part.slowdown = (active ? slowdown_active : slowdown_inactive) / length(mod_parts)
part.slowdown = (get_part_datum(part).sealed ? slowdown_active : slowdown_inactive) / length(mod_parts)
wearer?.update_equipment_speed_mods()
/obj/item/mod/control/proc/power_off()
@@ -705,6 +706,9 @@
uninstall(part)
return
if(part in get_parts())
var/datum/mod_part/part_datum = get_part_datum(part)
if(part_datum.sealed)
seal_part(part, is_sealed = FALSE)
if(isnull(part.loc))
return
if(!wearer)
@@ -733,6 +737,7 @@
var/datum/mod_part/part_datum = get_part_datum(part)
if(overslot != part_datum.overslotting)
return
UnregisterSignal(part, COMSIG_ATOM_EXITED)
part_datum.overslotting = null
/obj/item/mod/control/proc/on_potion(atom/movable/source, obj/item/slimepotion/speed/speed_potion, mob/living/user)