ID:264623
 
Code:
M.ailements += U.aile


Problem description:
In this situation:
M is type /mob/player
U s type /obj/ailement
ailements is a list on the mob (mob/var/list/ailements)
aile is the ailement the object applies to M, as text (EX "Poison")

For some reason, it's giving me a type mismatch error when I try to add the ailement applied by the object created into the player's ailement list. Is it no possible to add text into a list with += ?

Broken down, the code would be something like:

myplayer.ailement(list) += ailementobject.aile(ailement added)
("Poison")


runtime error: type mismatch: += "Poison"
proc name: Attack (/mob/monster/proc/Attack)
source file: Monsters.dm,3678
usr: Asch (/mob/player)
src: Lily (/mob/monster/Lily)
call stack:
Lily (/mob/monster/Lily): Attack(Asch (/mob/player))
Lily (/mob/monster/Lily): attackplayer(Asch (/mob/player))
Lily (/mob/monster/Lily): Agrcheck(Asch (/mob/player))
Lily (/mob/monster/Lily): Attack(Asch (/mob/player)
Make sure the "ailements" list is initialized.

And it's ailments, by the way :P
In response to DarkCampainger
DarkCampainger wrote:
Make sure the ailements list is initialized.

It is initialized as an empty list, since players start clean, naturally.
In response to Pyro_dragons
The error indicates your ailements var is not set to a list object. Use some debug output to verify the var's actual value, then fix your code so it ends up containing a list.
In response to Kaioken
And suddenly it works now. Sometimes code makes no sense. I didn't even change anything =/.