diff --git a/code/datums/mind.dm b/code/datums/mind.dm index a7fb80b87fb..4221db90798 100644 --- a/code/datums/mind.dm +++ b/code/datums/mind.dm @@ -919,6 +919,7 @@ if(vampire) vampire.remove_vampire_powers() qdel(vampire) + vampire = null ticker.mode.update_vampire_icons_removed(src) to_chat(current, "You grow weak and lose your powers! You are no longer a vampire and are stuck in your current form!") log_admin("[key_name(usr)] has de-vampired [key_name(current)]") diff --git a/code/game/gamemodes/vampire/hud.dm b/code/game/gamemodes/vampire/hud.dm index 727ae3bdc25..d02218ca542 100644 --- a/code/game/gamemodes/vampire/hud.dm +++ b/code/game/gamemodes/vampire/hud.dm @@ -6,4 +6,12 @@ vampire_blood_display.screen_loc = "WEST:6,CENTER-1:15" vampire_blood_display.layer = 20 - mymob.client.screen += list(vampire_blood_display) \ No newline at end of file + mymob.client.screen += list(vampire_blood_display) + +/datum/hud/proc/remove_vampire_hud() + if(!vampire_blood_display) + return + + mymob.client.screen -= list(vampire_blood_display) + qdel(vampire_blood_display) + vampire_blood_display = null \ No newline at end of file diff --git a/code/game/gamemodes/vampire/vampire.dm b/code/game/gamemodes/vampire/vampire.dm index 1abed5ba4dd..44f31b083ba 100644 --- a/code/game/gamemodes/vampire/vampire.dm +++ b/code/game/gamemodes/vampire/vampire.dm @@ -239,12 +239,11 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha if(!get_ability(path)) force_add_ability(path) -/datum/vampire/proc/remove_ability(path) - var/A = get_ability(path) - if(A) - powers -= A - owner.mind.spell_list.Remove(A) - qdel(A) +/datum/vampire/proc/remove_ability(ability) + if(ability && (ability in powers)) + powers -= ability + owner.mind.spell_list.Remove(ability) + qdel(ability) /mob/proc/make_vampire() if(!mind) @@ -263,6 +262,10 @@ You are weak to holy things and starlight. Don't go into space and avoid the Cha /datum/vampire/proc/remove_vampire_powers() for(var/P in powers) remove_ability(P) + if(owner.hud_used) + var/datum/hud/hud = owner.hud_used + if(hud.vampire_blood_display) + hud.remove_vampire_hud() owner.alpha = 255 /datum/vampire/proc/handle_bloodsucking(mob/living/carbon/human/H)