Skip to content

Commit

Permalink
mutation bug (#958)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kapu1178 authored May 24, 2024
1 parent 76bc854 commit 412ec61
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
2 changes: 1 addition & 1 deletion code/datums/dna.dm
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ GLOBAL_LIST_INIT(total_uf_len_by_block, populate_total_uf_len_by_block())
/datum/dna/proc/force_lose(datum/mutation/human/HM)
if(holder && (HM in mutations))
set_se(0, HM)
. = HM.on_losing(holder)
. = HM.remove_from_owner()
update_instability(FALSE)
return

Expand Down
14 changes: 8 additions & 6 deletions code/datums/mutations/_mutations.dm
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,19 @@
/datum/mutation/human/proc/on_life(delta_time, times_fired)
return

/datum/mutation/human/proc/on_losing(mob/living/carbon/human/owner)
/datum/mutation/human/proc/remove_from_owner()
. = on_losing(owner)
qdel(src)

/datum/mutation/human/proc/on_losing()
if(!istype(owner) || !(owner.dna.mutations.Remove(src)))
return TRUE

. = FALSE

if(text_lose_indication && owner.stat != DEAD)
to_chat(owner, text_lose_indication)

if(visual_indicators.len)
var/list/mut_overlay = list()
if(owner.overlays_standing[layer_used])
Expand All @@ -138,11 +145,6 @@
mut_overlay.Remove(get_visual_indicator())
owner.overlays_standing[layer_used] = mut_overlay
owner.apply_overlay(layer_used)
if(power_path)
// Any powers we made are linked to our mutation datum,
// so deleting ourself will also delete it and remove it
// ...Why don't all mutations delete on loss? Not sure.
qdel(src)

/mob/living/carbon/proc/update_mutations_overlay()
return
Expand Down
3 changes: 1 addition & 2 deletions code/datums/mutations/body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@
if(new_mob && ismob(new_mob))
owner = new_mob
. = owner
on_losing(owner)

remove_from_owner()

//Cough gives you a chronic cough that causes you to drop items.
/datum/mutation/human/cough
Expand Down
1 change: 1 addition & 0 deletions code/datums/mutations/hulk.dm
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
if(owner.health < owner.crit_threshold)
on_losing(owner)
to_chat(owner, span_danger("You suddenly feel very weak."))
remove_from_owner()

/datum/mutation/human/hulk/on_losing(mob/living/carbon/human/owner)
if(..())
Expand Down

0 comments on commit 412ec61

Please sign in to comment.