Skip to content

fix os.sleep(0) causing too long without yielding #3779

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master-MC1.7.10
Choose a base branch
from

Conversation

Ocawesome101
Copy link

It appears commit 7fecb07 broke os.sleep(0):

while true do os.sleep(0) end

as of oc 1.8.7/1.8.8 this cannot be interrupted, and will crash with too long without yielding, where in 1.8.6 and before this was not the case. may fix #3773

@TheRedCreations
Copy link

Hi. AGS-Dev here.
You are right about the broken os.sleep(). I just changed the os.sleep() to os.sleep(0.1) and the program works again.
Thank you.

@ff66theone
Copy link
Contributor

Why not using os.sleep(0.05) since a Minecraft ticks lasts 1/20 of a second (0.05s) ?
I know it only gains 0.05 seconds, but that's nearer from the pre-1.8.6 version.

@TheRedCreations
Copy link

I got told that 0.05 wouldn't work and 0.1 is minimum. but it works with 0.05 too.
Maybe i change that, or leave it as it is cause its only 0.05 difference.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asking community for help with debugging and fixing .lua script that crashes on new version of OC
3 participants