runtime error: type mismatch: Trained Fighter! (/Jutsus/Perks/Jutsus/T2_Taijutsu) += On-Edge! (/Jutsus/Perks/Jutsus/T1_Reflex)
proc name: Give Perk (/mob/admin/verb/Give_Perk)
source file: Perks.dm,165
usr: Haruka (/mob)
src: Haruka (/mob)
call stack:
Haruka (/mob): Give Perk(Character (/mob))
I'm receiving this runtime error when I use the "Give Perk()" verb. I have no clue why. The significant code is the following:
mob/var/list/UPerks = new()
verb
Give_Perk(mob/M in world)
set category = "Admin"
var/C = input("Choose the perk you shall give to [M].") as null|anything in Perks
if(C)
M.UPerks+=C
M.Save()
// M.UPerks.Add(C)
M<<"You were given [C] by [src]."
src<<"You gave [C] to [M]."
LogText("-Admin-[src.name]/[src.key] gave [M.name]/[M.key] the '[C]' perk.",0,1)
EDIT: Line 165 is M.UPerks+=C
Because DM is not type strict, even when the appropriate type has been declared, it is only used for accessing a type's fields. The type itself can be omitted and casted when needed.