NTStation / NTstation13

NTstation13 - A version of Spacestation13, forked from /tg/station13.
36 stars 198 forks source link

Fixed genetic spells ('Mutate' from wizard) #889

Closed ACCount12 closed 10 years ago

ACCount12 commented 10 years ago

USE CODE TESTING USE CODE TESTING USE CODE TESTING

RemieRichards commented 10 years ago

Any particular reason as to why it didn't work before?

ACCount12 commented 10 years ago

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.

RemieRichards commented 10 years ago

@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.

ACCount12 commented 10 years ago

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.

RemieRichards commented 10 years ago

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
ACCount12 commented 10 years ago
if(!ispath(PATH))
    return

If it is not path (aka type), function returns.

RemieRichards commented 10 years ago

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.

ACCount12 commented 10 years ago

var/list/mutations in spell is list of types var/list/organic_effects is mob is list of datums

RemieRichards commented 10 years ago

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.

ACCount12 commented 10 years ago

Merge?