ID:149804
 
Does the PayDimes() proc kill the calling proc as well if the 'Cancel' button is pushed?

ex:

obj/donate_button
icon = 'donate.dmi'
var
clicked = FALSE
Click()
if(clicked) return
clicked = TRUE
My_Function(usr)
clicked = FALSE
proc
My_Function()
if(usr.client.PayDimes(5,"Flick", "DONATE")
world << "Thanks"
else
world << "Thanks anyway"
return


If I click the object once, then click 'Cancel' on the PayDimes() input box, neither of the world outputs shows up, and I can't click the object anymore, as the Click() proc seems to have failed before reaching the 'clicked = FALSE' statement. I have found a way around this, but I would like to know if this is the way this is supposed to work or not.

flick()




Do this.

obj/donate
icon='donate.dmi'
Click(K as num)
if(usr.client.PayDimes(K,"Flick"))
if(K==0)
return
else
world<<"[usr] has donated [K] dime\s"
In response to Super16
Super16 wrote:
Do this.

obj/donate
icon='donate.dmi'
Click(K as num)
if(usr.client.PayDimes(K,"Flick"))
if(K==0)
return
else
world<<"[usr] has donated [K] dime\s"

Like I said, I've got a way around it that works, I'm just curious how its supposed to work. I guess I should also specify, that if I click 'Authorize payment' everything works fine... if I don't enter a password, I get a transaction cancelled message, and the "Thanks anyway" message. Its just if I actually click 'Cancel' that it dies.
In response to Flick
Flick wrote:
Like I said, I've got a way around it that works, I'm just curious how its supposed to work. I guess I should also specify, that if I click 'Authorize payment' everything works fine... if I don't enter a password, I get a transaction cancelled message, and the "Thanks anyway" message. Its just if I actually click 'Cancel' that it dies.

Well this code won't screw up when you click Cancel.
In response to Super16
The code I'm actually using now doesn't either, I just want to know why this code does. :)