mob/Cross ( skill/_skill )
.. ( )
if ( ! ( istype ( src , /mob/npc ) ) )
if ( istype ( _skill , /skill ) && _skill.damage && _skill.owner )
take_damage ( _skill.damage , _skill.owner )
if ( _skill.damage > 50000 && istype ( _skill , /skill/blast ) )
crater ( loc )
_skill.remove ( )
skill
parent_type = /obj
var
attack_sound
damage
mob/owner
New ( _damage , mob/_owner )
dir = _owner.dir
loc = _owner.loc
owner = _owner
damage = _damage
density = _owner.density
move ( )
//spawn ( 50 )
// remove ( )
. = .. ( ) //As a side-question, is this the proper way to do this
proc
move ( )
walk ( src , dir )
//spawn ( 50 )
// remove ( )
remove ( )
if ( src && loc )
loc = null
walk ( src , 0 )
It doesn't matter if I spawn remove() in move() or in New(), in mob/Cross() when I call _skill.remove(), it doesn't do anything; it's removed when the spawn calls remove().
That's a problem because I need to remove the skill immediately rather than the 5 seconds or however long after it hits a mob.
When it's called from mob/Cross() it gets to the end of remove(), however the skill is still visible on the map until the spawn calls it. I can simply null the icon_state to hide it until the spawn calls remove() but I'd rather null the location of the skill obj itself immediately, rather than wait.
Am I going about this incorrectly or am I just not understanding why it's acting like it is?
In New() you don't need to assign ..() to . or alter the return value in any way. Just calling ..() is fine.
In mob/Cross(), calling ..() is meaningless unless you return its value. Your mob/Cross() proc is effectively always returning 0.
Cross() is not actually the correct place to trigger an action. You want Crossed() for that.
I would recommend adding some debug output to see which sections of the code are being reached.