Files
42e7324b69 [MODULAR] Fixes some edge cases with chaplain religion resetting (#23247)
* Fixes some edge cases with chaplain religion resetting

* Whoops

* Update _mind.dm

* Update _mind.dm

* Apply suggestions from code review

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>

---------

Co-authored-by: GoldenAlpharex <58045821+GoldenAlpharex@users.noreply.github.com>
2023-08-26 10:54:00 -07:00

12 lines
455 B
Plaintext

// Free chaplain highpriest role if the chaplain's mind gets deleted for some reason
/datum/mind/Destroy()
var/list/holy_successors = list_holy_successors()
if(current && (current in holy_successors)) // if this mob was a holy successor then remove them from the pool
GLOB.holy_successors -= WEAKREF(src)
// Handle freeing the high priest role for the next chaplain in line
if(holy_role == HOLY_ROLE_HIGHPRIEST)
reset_religion()
return ..()