diff --git a/code/modules/antagonists/wizard/equipment/spellbook.dm b/code/modules/antagonists/wizard/equipment/spellbook.dm index 2113572e716..6e011ea3143 100644 --- a/code/modules/antagonists/wizard/equipment/spellbook.dm +++ b/code/modules/antagonists/wizard/equipment/spellbook.dm @@ -647,7 +647,9 @@ /// Determines if this spellbook can refund anything. var/can_refund = TRUE - var/mob/living/carbon/human/owner + /// The mind that first used the book. Automatically assigned when a wizard spawns. + var/datum/mind/owner + var/list/entries = list() /obj/item/spellbook/examine(mob/user) @@ -685,16 +687,18 @@ /obj/item/spellbook/attack_self(mob/user) if(!owner) + if(!user.mind) + return to_chat(user, span_notice("You bind the spellbook to yourself.")) - owner = user + owner = user.mind return - if(user != owner) + if(user.mind != owner) if(user.mind.special_role == ROLE_WIZARD_APPRENTICE) to_chat(user, "If you got caught sneaking a peek from your teacher's spellbook, you'd likely be expelled from the Wizard Academy. Better not.") else to_chat(user, span_warning("The [name] does not recognize you as its owner and refuses to open!")) return - . = ..() + return ..() /obj/item/spellbook/attackby(obj/item/O, mob/user, params) if(!can_refund) diff --git a/code/modules/clothing/outfits/standard.dm b/code/modules/clothing/outfits/standard.dm index 40f8aba297c..04c45a2cdbc 100644 --- a/code/modules/clothing/outfits/standard.dm +++ b/code/modules/clothing/outfits/standard.dm @@ -329,13 +329,13 @@ r_pocket = /obj/item/teleportation_scroll l_hand = /obj/item/staff -/datum/outfit/wizard/post_equip(mob/living/carbon/human/H, visualsOnly = FALSE) +/datum/outfit/wizard/post_equip(mob/living/carbon/human/wizard, visualsOnly = FALSE) if(visualsOnly) return - var/obj/item/spellbook/S = locate() in H.back - if(S) - S.owner = H + var/obj/item/spellbook/new_spellbook = locate() in wizard.back + if(new_spellbook) + new_spellbook.owner = wizard.mind /datum/outfit/wizard/apprentice name = "Wizard Apprentice"