ID:2237611
 
Code:
obj/Abilities   
Click(location, control)
if(control != "Skills.grid")
if(Mastery<MaxMastery)
Mastery+=rand(0.002,0.005)
if(Mastery>MaxMastery) Mastery=MaxMastery
spawn(5*world.tick_lag) usr.Regeneration()
spawn(10) usr.Learn(src)
..()


Problem description:
The problem is that although the control is specified and through DEBUGGING; outputting in the world the current value of 'control' (which it specifies as Skills.grid) it still doesn't stop the child function from proceeding. I am trying to stop the child's click() function from occuring if the control is in "Skills.grid" which it isn't doing.

Child Object
obj/Abilities/Rest
icon_state="Rest"
cooldown=10
cost=1
MaxMastery=1
Click()
..()
if(usr.Unconcious||usr.Meditate) return
if(!usr.Resting)
// Blah Blah Blah
else
// Blah Blah Blah
If it's not responding how you want it to, first make sure you're referencing the correct control by using
world.log << control


However, the real error I can see is that in obj/Abilities/Rest, the Click proc will continue regardless of whether the control is Skill.grid or not.

You need to make some kind of check.


obj/Abilities   
Click(location, control)
if(control != "Skills.grid")
if(Mastery<MaxMastery)
Mastery+=rand(0.002,0.005)
if(Mastery>MaxMastery) Mastery=MaxMastery
spawn(5*world.tick_lag) usr.Regeneration()
spawn(10) usr.Learn(src)
return 1


obj/Abilities/Rest
icon_state="Rest"
cooldown=10
cost=1
MaxMastery=1
Click()
if(..())
if(usr.Unconcious||usr.Meditate) return
if(!usr.Resting)
// Blah Blah Blah
else
// Blah Blah Blah


Now Click obj/Abilities/Rest will only continue if Click obj/Abilities returns a positive value.