Closed ACCount12 closed 10 years ago
Any particular reason as to why it didn't work before?
When using for(var/datum/D in list), you will loop over all /datum typed objects in list. But not over 'type' vars and not over 'text' vars with /datum types inside.
@ACCount12 But it wasn't pure datum, it was typecasted to what it should have been?
I'm not concerned with anything, this will get merged, I'm just curious as to why it didn't work before.
var/list/mutations is list of types, not datums. And even if it was list of datums, it will not work. add_organic_blah_blah() accepts only types AFAIK.
Are you sure?
/mob/proc/add_organic_effect(var/PATH)
if(!ispath(PATH))
return
var/datum/organic_effect/OE = new PATH
organic_effects += OE
OE.owner = src
if(!ispath(PATH))
return
If it is not path (aka type), function returns.
That wasn't really the point I was getting at, You say it's a list of Types, yes? But this list is only added to after a New, Which means the datum exists, meaning the list should be a list of datums, and not a list of types.
var/list/mutations in spell is list of types var/list/organic_effects is mob is list of datums
Oh bugger! The list is Mutations! Sorry, God what the hell was I thinking when I wrote that.
I think that the Mutations list there should probably be the organic_effects list though.
Merge?
USE CODE TESTING USE CODE TESTING USE CODE TESTING