mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-27 23:14:18 +01:00
Fix Cryopod Runtime Error (#22492)
This is a fix for https://aurorastation.sentry.io/issues/7405385361 Which I believe might actually also be one of the elusive "niche human hard dels" that are so hard to track down since this runtime would also prevent a key memory deallocation from occurring.
This commit is contained in:
@@ -122,10 +122,10 @@ SUBSYSTEM_DEF(jobs)
|
||||
Debug("AR has failed, Player: [player], Rank: [rank]")
|
||||
return FALSE
|
||||
|
||||
/datum/controller/subsystem/jobs/proc/FreeRole(var/rank)
|
||||
var/datum/job/job = GetJob(rank)
|
||||
if(!istype(job))
|
||||
return
|
||||
/datum/controller/subsystem/jobs/proc/FreeRole(rank)
|
||||
astype(GetJob(rank), /datum/job)?.current_positions--
|
||||
|
||||
/datum/controller/subsystem/jobs/proc/FreeJob(datum/job/job)
|
||||
job.current_positions--
|
||||
|
||||
/datum/controller/subsystem/jobs/proc/FindOccupationCandidates(datum/job/job, level, flag)
|
||||
@@ -620,13 +620,12 @@ SUBSYSTEM_DEF(jobs)
|
||||
|
||||
//Handle job slot/tater cleanup.
|
||||
if (H.mind)
|
||||
var/role = H.mind.assigned_role
|
||||
var/datum/job/job = GetJob(H.mind.assigned_role)
|
||||
job.on_despawn(H)
|
||||
FreeRole(role)
|
||||
if(H.mind.objectives.len)
|
||||
qdel(H.mind.objectives)
|
||||
H.mind.special_role = null
|
||||
if (job)
|
||||
job.on_despawn(H)
|
||||
FreeJob(job)
|
||||
QDEL_LIST(H.mind.objectives)
|
||||
H.mind.special_role = null
|
||||
|
||||
// Delete them from datacore.
|
||||
if(ishuman(H))
|
||||
|
||||
Reference in New Issue
Block a user