Fixes #4306 (When a head goes into cryo storage during Rev, a random crewmember is chosen as a target instead.)

Conflicts:
	code/game/machinery/cryopod.dm
This commit is contained in:
Zuhayr
2014-02-14 13:56:33 +01:00
committed by alex-gh
parent 85b59532fe
commit 438e48a5c1
+15 -13
View File
@@ -211,20 +211,22 @@ obj/machinery/computer/cryopod/Topic(href, href_list)
frozen_items += W
//Update any existing objectives involving this mob.
for(var/mob/living/M in world) //There has to be a more efficient way to do this.
if(!(M.mind) || !(M.mind.objectives.len)) continue
for(var/datum/objective/O in all_objectives)
if(istype(O,/datum/objective/mutiny)) //We don't want revs to get objectives that aren't for heads of staff. Letting them win or lose based on cryo is silly so we remove the objective.
del(O) //TODO: Update rev objectives on login by head (may happen already?) ~ Z
else if(O.target && istype(O.target,/datum/mind))
if(O.target == occupant.mind)
if(O.owner && O.owner.current)
O.owner.current << "\red You get the feeling your target is no longer within your reach. Time for Plan [pick(list("A","B","C","D","X","Y","Z"))]..."
O.target = null
spawn(1) //This should ideally fire after the occupant is deleted.
if(!O) return
O.find_target()
if(!(O.target))
all_objectives -= O
O.owner.objectives -= O
del(O)
for(var/datum/objective/O in M.mind.objectives)
if(O.target && istype(O.target,/datum/mind))
if(O.target == occupant.mind)
if(O.owner && O.owner.current)
O.owner.current << "\red You get the feeling your target is no longer within your reach. Time for Plan [pick(list("A","B","C","D","X","Y","Z"))]..."
O.target = null
spawn(1) //This should ideally fire after the occupant is deleted.
if(!O) return
O.find_target()
if(!(O.target))
O.owner.objectives -= O
//Handle job slot/tater cleanup.
var/job = occupant.mind.assigned_role