ID:141904
 
        flame
icon_state="flame"
name="Flame"
speed=5
length=7
damage=5
density=0
trigger(mob/m)
if(ismob(m)&&m.type!=/mob/monster/demon) //only players and anything either than demons can be hurt by flames.
m.damage_calc(src)
Move()
..()
var/atom/location=src.loc
for(var/mob/m in location)
if(ismob(m)&&m.type!=/mob/monster/demon)
m.damage_calc(src)
I don't understand why when I check to make sure that m isn't a demon, it still hurts the demon! I already did try it with 'm.type', and it didn't make a difference, I can't see why this wouldn't work for stopping the demon from hurting itself.
There's an indentation error in your coding? The very first line. It looks like it needs to be tabbed back twice.
Is the actual monster a subtype of /mob/monster/demon? If so, your check will fail, since /mob/monster/demon isn't equal to, say, /mob/monster/demon/flame_demon, since it's a different value - and so the indented code will run. If this is the case (and even if not for general robustness), use the istype() or ispath() proc (for object instances, it's more convenient to stick with the former) to check if an object is of a given type OR descended from it.

Also, you should make sure actual movement occurred before triggering the effect - you probably don't want or expect the damage to trigger [again] in the flame's current location if a movement failed. You can check if the movement succeeded or not by checking the original Move()'s return value (look it up) - which note overrides such as yours break procs' return values so other callers can't use them, as they don't return the value back to the caller. You should use return or the '.' var to pass on the value ..() returns to the caller of the proc as well so it can access it.
Move()
. = ..() //call ..() and store its return value into a variable
//the . variable is also returned at the end of procs, \
so if code calls Move() it can also know what the original\
return value is.

if(.) //if it returned a true value
//do your stuff
//return . //this instruction is implicit


Also, you don't need the ismob() check inside the for() loop. The for() loop already filters the object types in the list location.contents (you also don't need the location var, BTW...) for you and it will only iterate through mobs anyway, so checking if the looped objects are mobs is superfluous. Take another look in its reference entry for additional info.
In response to Kaioken
Ah, thanks for giving me a better understanding behind .=..(), I had no idea what it did before, now that I know it will come in handy. As for the istype, I'm not sure why, but I somehow forgot about it. Thanks Kaioken!

Edit: However, it's still not working correctly. The type path for my demon is: mob/monster/demon, I know I have it correct. The demons are still hurting each other :/

        flame
icon_state="flame"
name="Flame"
speed=5
length=7
damage=5
density=0
trigger(mob/m)
if(ismob(m)&&!istype(m,/mob/monster/demon)) //only players and anything either than demons can be hurt by flames.
m.damage_calc(src)
Move()
.=..()
if(.)
for(var/mob/m in src.loc)
if(!istype(m,/mob/monster/demon)) //as long as it isn't a demon...
m.damage_calc(src)
EDIT: I'm also overriding the main effect all bullets have:
                    for(var/mob/m in src.loc)
if(istype(m,/mob/monster/demon)) //as long as it isn't a demon...
return
m.damage_calc(src)
In response to Speedro
That's weird, it looks like it should work. Perhaps you should add debugging info and see what gives? Before the m.damage_calc() call, add:
world << "running damage proc on [m]([m.type])"

This way you can confirm it's definitely doing something it shouldn't, if after something like if(!istype(m,/mob/monster/demon)) it runs the code after it and it says it's a demon.
In response to Kaioken
Odd; I didn't even recieve the debug message. ...Which leads me to believe it has something to do with me not overriding my previously made Move procedure that's a shared trait amongst all bullet types:
        Move()
..()
var/atom/location=src.loc
for(var/mob/m in location)
if(src.extra)
del src
return
m.damage_calc(src)
del src
if(location.density)
del src
Okay, it works when I add return, but only when I enter the flame. I want it so regardless if I enter the flame or it enters me. :s


EDIT: My solution ;)

obj
Move()
.=..()
if(.)
for(var/mob/m in src.loc)
src.trigger(m)