diff --git a/code/datums/spell.dm b/code/datums/spell.dm index 747b109a912..e8b3d69ef33 100644 --- a/code/datums/spell.dm +++ b/code/datums/spell.dm @@ -135,7 +135,7 @@ var/list/spells = typesof(/obj/effect/proc_holder/spell) //needed for the badmin return /obj/effect/proc_holder/spell/proc/start_recharge() - while(charge_counter < charge_max) + while(charge_counter < charge_max && !isnull(gc_destroyed)) sleep(1) charge_counter++ diff --git a/code/datums/spells/inflict_handler.dm b/code/datums/spells/inflict_handler.dm index 7c3e810a008..96c2dc77ba2 100644 --- a/code/datums/spells/inflict_handler.dm +++ b/code/datums/spells/inflict_handler.dm @@ -27,10 +27,12 @@ target.gib() if("gib_brain") if(ishuman(target) || ismonkey(target)) - var/obj/item/organ/brain/B = target.getorgan(/obj/item/organ/brain) + var/mob/living/carbon/C_target = target + var/obj/item/organ/brain/B = C_target.getorgan(/obj/item/organ/brain) if(B) - B.loc = get_turf(target) - B.transfer_identity(target) + B.loc = get_turf(C_target) + B.transfer_identity(C_target) + C_target.internal_organs -= B target.gib() if("disintegrate") target.dust() diff --git a/code/game/gamemodes/wizard/wizard.dm b/code/game/gamemodes/wizard/wizard.dm index 6306d8d5a6b..e86415a7a11 100644 --- a/code/game/gamemodes/wizard/wizard.dm +++ b/code/game/gamemodes/wizard/wizard.dm @@ -263,8 +263,11 @@ //To batch-remove wizard spells. Linked to mind.dm. /mob/proc/spellremove(var/mob/M as mob) + if(!mind) + return for(var/obj/effect/proc_holder/spell/spell_to_remove in src.mind.spell_list) qdel(spell_to_remove) + mind.spell_list -= spell_to_remove /*Checks if the wizard can cast spells. Made a proc so this is not repeated 14 (or more) times.*/ diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 64ac3a4cc00..645e0290a2a 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -8,8 +8,7 @@ qdel(AM) client.screen = list() del(hud_used) - for(var/magic in mob_spell_list) - del(magic) + spellremove(src) for(var/infection in viruses) del(infection) ghostize()