ID:264827
 
Code:
obj
var/Owner9
clematisvine
icon = 'kaguyadots.dmi'
density = 1
New(loc,o,d)
..()
Owner9 = o
dir = d
spawn(20)
for(var/obj/clematisvine/B)
if(B.Owner9 == Owner9)
del B
head
icon_state = "vine"
New()
..()
walk(src,src.dir)
Move() //Every time the head of the firedragon moves...
..()
var/turf/T1 = get_step(src,src.dir) //check if there's a turf in front of the head of the firedragon.
if(!T1) //If the turf does not exists...
for(var/obj/clematisvine/B) //find all firedragons...
if(B.Owner9 == Owner9) //that belong to the owner...
del B
flick('explosion.dmi',T1) //and delete them.
var/turf/T2 = get_step(src,turn(src.dir,180)) //check the turf behind the head of the firedragon...
if(T2) new/obj/clematisvine/tail(T2,Owner9,dir) //and if it exists, create a tail obj of the firedragon there.
for(var/obj/clematisvine/tail/C)
if(!src)
del(C)
var/owner
Bump(A)
if(ismob(A))
var/mob/M = A //this is to be used when doing damage etc //this is to be used when doing damage etc
var/mob/O = src.Owner9
M.frozen=1
var/obj/vinecapture/T = new /obj/vinecapture
T.loc = locate(M.x,M.y,M.z)
view()<<"[O] captured [M] with the Clematis Vine Dance."
sleep(20)
del(T)
M.frozen=0
del(src)
if(istype(A,/turf/))
var/turf/T = A
if(T.density == 1)
del(src)
if(istype(A,/obj/))
del(src)
tail
icon_state = "vinetail"


Problem description: Ok, so when that bumps into M it doesn't do the message or anything like it should and it doesn't delete the obj/T like it should.

view() defaults to view(usr), and usr in not valid in procs. Use view(src) instead.

The object isn't being deleted because src is being deleted first. You need to have the object delete itself in some separate proc (such as its New() proc).

Looping through every object in the world with for(var/obj/clematisvine/B) is a terrible idea: it's slow and will likely result in the head deleting itself first, which will break things. Just have the head maintain a list of all the tail objects it's created, and loop through that instead.

Also, the line "if(!src)" is useless. That will never, ever be true. I'm not sure what you intended that to be.