ID:138333
 
Why does the line:

var/obj/newagree = new /obj/clickable/agree(player2)

generate variable-defined-but-not-used warnings? Those drive me nuts.

Z
On 10/26/00 1:28 pm Zilal wrote:
Why does the line:

var/obj/newagree = new /obj/clickable/agree(player2)

generate variable-defined-but-not-used warnings? Those drive me nuts.

Z

Do you do anything with the newagree variable later in the function?

If not, that would cause this error, which is basically trying to help you avoid bugs.

If you are using newagree in the function, it might be helpful to post that code so Dantom can see if they are missing a case (I've run into one of those in the past).

Now, if you just want to create the agree object and don't need to keep a reference to it in this function, you can just drop the variable assignment, like so:

new /obj/clickable/agree(player2)
In response to Deadron
On 10/26/00 1:33 pm Deadron wrote:
Do you do anything with the newagree variable later in the function?

Not by your definition, but I always thought that creating a new object and placing it somewhere should count as "doing something," and was wondering why it didn't.

Now, if you just want to create the agree object and don't need to keep a reference to it in this function, you can just drop the variable assignment, like so:

new /obj/clickable/agree(player2)

Ohhh... thanks!

Z