You have to create an object that creates an object that sleeps, then delete the object that sleeps via the first object, and sleeping cannot be done in New()
So you can't create a single object then delete it elsewhere to stop the sleeping.
Descriptive Problem Summary:
The DM reference says that if the source of a procedure that calls sleep is deleted, then termination stops immediately.
The DM guide lies
Numbered Steps to Reproduce Problem:
1.)Sleep
2.)delete object that called sleep
3.)not wat i want
Code Snippet (if applicable) to Reproduce Problem:
var/obj/test/test
client
Click()
del test
mob
verb
test()
test = new
world<<"Pie"
obj
test
New()
..()
sleep(9000)
Expected Results:
INSTANTLY BAKED PIE!
Actual Results:
BURNT PIE! (not instantly baked)
Does the problem occur:
Every time? Or how often? Every time
In other games? Wot
In other user accounts? ya
On other computers? si
When does the problem NOT occur?
never :(
Did the problem NOT occur in any earlier versions? If so, what was the last version that worked? (Visit http://www.byond.com/download/build to download old versions for testing.)
It worked in earlier versions, prior to 5.0. I'm gonna guess it has something to do with that new fangled threading thing you have going on (fancy stuff) but I can't be certain.
Workarounds:
while(object)
sleep(1)