mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-24 04:27:35 +01:00
Some Flockmind Bug Fixes (#32454)
* Fixes flock collector runtime * Potentially fixes nullspacing flockminds
This commit is contained in:
+17
-18
@@ -134,7 +134,7 @@
|
||||
if(isliving(current))
|
||||
destroyed_body_json = json_encode(current.serialize())
|
||||
|
||||
/datum/mind/proc/bind_to(mob/living/new_character)
|
||||
/datum/mind/proc/bind_to(mob/new_character)
|
||||
current = new_character
|
||||
new_character.mind = src
|
||||
RegisterSignal(current, COMSIG_PARENT_QDELETING, PROC_REF(archive_deleted_body), override = TRUE)
|
||||
@@ -147,11 +147,9 @@
|
||||
current.mind = null
|
||||
current = null
|
||||
|
||||
/datum/mind/proc/transfer_to(mob/living/new_character)
|
||||
/datum/mind/proc/transfer_to(mob/new_character, transfer_actions_to_target = TRUE)
|
||||
var/datum/atom_hud/antag/hud_to_transfer = antag_hud //we need this because leave_hud() will clear this list
|
||||
var/mob/living/old_current = current
|
||||
if(!istype(new_character))
|
||||
stack_trace("transfer_to(): Some idiot has tried to transfer_to() a non mob/living mob.")
|
||||
var/mob/old_current = current
|
||||
if(current) //remove ourself from our old body's mind variable
|
||||
if(isliving(current))
|
||||
current.med_hud_set_status()
|
||||
@@ -168,19 +166,20 @@
|
||||
|
||||
bind_to(new_character)
|
||||
|
||||
for(var/a in antag_datums) //Makes sure all antag datums effects are applied in the new body
|
||||
var/datum/antagonist/A = a
|
||||
A.on_body_transfer(old_current, current)
|
||||
transfer_antag_huds(hud_to_transfer) //inherit the antag HUD
|
||||
transfer_actions(new_character)
|
||||
if(martial_art)
|
||||
for(var/datum/martial_art/MA in known_martial_arts)
|
||||
MA.reset_combos(old_current) // Clear combos on old body
|
||||
if(MA.temporary)
|
||||
MA.remove(current)
|
||||
else
|
||||
MA.remove(current)
|
||||
MA.teach(current)
|
||||
if(transfer_actions_to_target)
|
||||
for(var/a in antag_datums) //Makes sure all antag datums effects are applied in the new body
|
||||
var/datum/antagonist/A = a
|
||||
A.on_body_transfer(old_current, current)
|
||||
transfer_antag_huds(hud_to_transfer) //inherit the antag HUD
|
||||
transfer_actions(new_character)
|
||||
if(martial_art)
|
||||
for(var/datum/martial_art/MA in known_martial_arts)
|
||||
MA.reset_combos(old_current) // Clear combos on old body
|
||||
if(MA.temporary)
|
||||
MA.remove(current)
|
||||
else
|
||||
MA.remove(current)
|
||||
MA.teach(current)
|
||||
if(active)
|
||||
new_character.key = key //now transfer the key to link the client to our new body
|
||||
SEND_SIGNAL(src, COMSIG_MIND_TRANSER_TO, new_character)
|
||||
|
||||
@@ -399,8 +399,7 @@
|
||||
controlled_by.controlling_bird = src
|
||||
|
||||
if(controlled_by.mind)
|
||||
key = controlled_by.key
|
||||
mind = controlled_by.mind
|
||||
controlled_by.mind.transfer_to(src, FALSE)
|
||||
|
||||
if(isflocktrace(controlled_by))
|
||||
flock.add_notice(src, FLOCK_NOTICE_FLOCKTRACE_CONTROL)
|
||||
@@ -440,8 +439,7 @@
|
||||
|
||||
master_bird.forceMove(destination)
|
||||
if(mind)
|
||||
master_bird.key = key
|
||||
master_bird.mind = mind
|
||||
mind.transfer_to(master_bird, FALSE)
|
||||
|
||||
flock_talk(null, "Control of [real_name] surrendered.", flock, involuntary = TRUE)
|
||||
if(!dest_was_safe)
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
var/area/A = get_area(src)
|
||||
var/obj/machinery/power/apc/apc
|
||||
if(A.apc)
|
||||
apc = A.apc[0]
|
||||
apc = A.get_apc()
|
||||
return apc
|
||||
|
||||
/// Recalculate the turf connections and tracking.
|
||||
|
||||
@@ -36,9 +36,7 @@
|
||||
kill()
|
||||
return
|
||||
var/mob/camera/flock/overmind/flockmind = new /mob/camera/flock/overmind(pick(spawn_locs))
|
||||
flockmind.key = C.key
|
||||
flockmind.mind = new
|
||||
flockmind.mind.bind_to(flockmind)
|
||||
C.mind.transfer_to(flockmind, FALSE)
|
||||
flockmind.mind.set_original_mob(flockmind)
|
||||
flockmind.mind.assigned_role = SPECIAL_ROLE_FLOCK
|
||||
flockmind.mind.special_role = SPECIAL_ROLE_FLOCK
|
||||
|
||||
Reference in New Issue
Block a user