cannot eat food
#11
I now believe I know the cause of this. On Windows, the clock() function returns some kind of a measure of real time elapsed, which is what we want. But on Linux, it returns the CPU time elapsed, which counts each thread's time separately (so you can have 2 seconds when the program is running 2 threads for 1 second each) and doesn't include the time spent in syscalls (so it can report 0.01 seconds if all the threads are sleeping in a syscall for a minute).
This is probably the cause of both the eating issues and the pickup collection issues, because they both rely on world age, instead of number of ticks; and world age depends on the clock() function. I'll try fixing it now.
Reply
Thanks given by:


Messages In This Thread
cannot eat food - by e_mcserver@openstandards.net - 08-20-2013, 02:17 AM
RE: cannot eat food - by bearbin - 08-20-2013, 03:03 AM
RE: cannot eat food - by tonibm19 - 08-20-2013, 03:24 AM
RE: cannot eat food - by bearbin - 08-20-2013, 04:38 AM
RE: cannot eat food - by NiLSPACE - 08-20-2013, 04:40 AM
RE: cannot eat food - by NiLSPACE - 08-20-2013, 05:52 AM
RE: cannot eat food - by xoft - 08-20-2013, 06:00 AM
RE: cannot eat food - by bearbin - 08-20-2013, 06:02 AM
RE: cannot eat food - by xoft - 08-20-2013, 06:10 AM
RE: cannot eat food - by xoft - 08-20-2013, 06:26 AM
RE: cannot eat food - by xoft - 08-20-2013, 06:56 AM
RE: cannot eat food - by xoft - 08-20-2013, 07:46 AM



Users browsing this thread: 1 Guest(s)