ID:157334
 
mob
var/soldiernothappy = 1
soldier //all mob/soldier's have the default click
Click()
if(soldiernothappy)
world << "no."
return

penguin
Click() //however, the penguin doesn't have default Click\
but i still want it to run everything in the original procedure\
so if the penguin isn't happy, it won't run the continuation of this

world << "DAMAGE" //this line should only appear if the variable above was false.


The code has the problem in it, but I want this to work, as a time saver and to keep things less confusing. Calling the parent proc doesn't seem to help (..()) because even when called return doesn't stop the second Click from running because they're separate events...
..()
Yes. ..() will call the parent procedure. .=..() additionally stores the return value of the parent procedure into the variable . which is returned by default, and so is more useful for procedures like Move() which have an important return value.
In response to Garthor
So what is the simplest way have having the two procedures interact via they're pretty much the same proc only seperated, so that the return statement would work here?


EDIT: Like this?


mob
var/soldiernothappy = 1
soldier //all mob/soldier's have the default click
Click()
if(soldiernothappy)
world << "no."
return 1

penguin

Click() //however, the penguin doesn't have default Click\
but i still want it to run everything in the original procedure\
so if the penguin isn't happy, it won't run the continuation of this

.=..()
if(!.)
world << "DAMAGE" //this line should only appear if the variable above was false.
In response to Speedro
Why is the path for the penguin? /mob/soldier/penguin
Did you mean to put it /mob/penguin?
In response to Ya Diggg
That's kind of irrelevant, but yes.
In response to Speedro
Then whatever you had before should work