From 01b4d9e811f0ec3b1f380e2571f3ad4eaccc2187 Mon Sep 17 00:00:00 2001 From: spookydonut Date: Mon, 27 Jan 2020 04:48:42 +0800 Subject: [PATCH] Fix cast() parameters (#48997) About The Pull Request Working on detecting type mismatches of parameters for SpacemanDMM and discovered these. I also checked by hand that all uses of cast() provide a list as the first argument. --- code/datums/mutations/actions.dm | 8 ++++---- code/modules/spells/spell.dm | 2 +- code/modules/spells/spell_types/soultap.dm | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/code/datums/mutations/actions.dm b/code/datums/mutations/actions.dm index 881e0ebd90c..eae7522511d 100644 --- a/code/datums/mutations/actions.dm +++ b/code/datums/mutations/actions.dm @@ -187,7 +187,7 @@ if(!isturf(user.loc)) return FALSE -/obj/effect/proc_holder/spell/self/void/cast(mob/user = usr) +/obj/effect/proc_holder/spell/self/void/cast(list/targets, mob/user = usr) . = ..() new /obj/effect/immortality_talisman/void(get_turf(user), user) @@ -210,7 +210,7 @@ charge_max = 100 action_icon_state = "autotomy" -/obj/effect/proc_holder/spell/self/self_amputation/cast(mob/user = usr) +/obj/effect/proc_holder/spell/self/self_amputation/cast(list/targets, mob/user = usr) if(!iscarbon(user)) return @@ -252,7 +252,7 @@ action_icon_state = "spike" var/spike_path = /obj/item/hardened_spike -/obj/effect/proc_holder/spell/self/tongue_spike/cast(mob/user = usr) +/obj/effect/proc_holder/spell/self/tongue_spike/cast(list/targets, mob/user = usr) if(!iscarbon(user)) return @@ -408,7 +408,7 @@ to_chat(user, "There's already a web here!") return FALSE -/obj/effect/proc_holder/spell/self/lay_genetic_web/cast(mob/user = usr) +/obj/effect/proc_holder/spell/self/lay_genetic_web/cast(list/targets, mob/user = usr) var/turf/T = get_turf(user) user.visible_message("[user] begins to secrete a sticky substance.","You begin to lay a web.") diff --git a/code/modules/spells/spell.dm b/code/modules/spells/spell.dm index d27728018e8..ff88b3cca1e 100644 --- a/code/modules/spells/spell.dm +++ b/code/modules/spells/spell.dm @@ -552,7 +552,7 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th school = "restoration" sound = 'sound/magic/staff_healing.ogg' -/obj/effect/proc_holder/spell/self/basic_heal/cast(mob/living/carbon/human/user) //Note the lack of "list/targets" here. Instead, use a "user" var depending on mob requirements. +/obj/effect/proc_holder/spell/self/basic_heal/cast(list/targets, mob/living/carbon/human/user) //Note the lack of "list/targets" here. Instead, use a "user" var depending on mob requirements. //Also, notice the lack of a "for()" statement that looks through the targets. This is, again, because the spell can only have a single target. user.visible_message("A wreath of gentle light passes over [user]!", "You wreath yourself in healing light!") user.adjustBruteLoss(-10) diff --git a/code/modules/spells/spell_types/soultap.dm b/code/modules/spells/spell_types/soultap.dm index eb4fa112d29..c152c89f8c0 100644 --- a/code/modules/spells/spell_types/soultap.dm +++ b/code/modules/spells/spell_types/soultap.dm @@ -17,7 +17,7 @@ action_icon = 'icons/mob/actions/actions_spells.dmi' action_icon_state = "soultap" -/obj/effect/proc_holder/spell/self/tap/cast(mob/living/user = usr) +/obj/effect/proc_holder/spell/self/tap/cast(list/targets, mob/living/user = usr) if(!user.mind.hasSoul) to_chat(user, "You do not possess a soul to tap into!") return