mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-28 17:01:14 +00:00
07b92534019dc9bb711cdb4d6796ce65969449d0
The processing thread counted the remaining time down in 1000 ms steps and read the global CurrentProgress on every wake, which caused two problems. Any duration that is not a whole number of seconds finished late, since the thread only checked after another full second. The NUI bar runs on wall clock time, so the bar completed and the player then stood frozen waiting for onFinish. Cancelling did not stop the thread either. CancelProgressbar clears CurrentProgress, but the sleeping thread only notices up to a second later, and if a new bar was started in that window it saw a non-nil CurrentProgress and kept decrementing the new one alongside its own thread. The new bar then finished at roughly half its length, firing onFinish early. The run now carries an id, so a thread stops as soon as its run is no longer the current one, and the end is an absolute timestamp rather than a countdown. Measured in game on artifact 25770, requested versus actual onFinish: before: 500 -> 1011, 4200 -> 5042, cancel then 3000 -> 1427 after: 500 -> 519, 4200 -> 4222, cancel then 3000 -> 3058
ESX Legacy
Discord - Website - Documentation
Want more resources? You can browse the Cfx.re Releases board for more!
ESX is the leading framework, trusted by over 12,000 communities to provide the highest quality roleplay servers on FiveM
💗 Supporters
Interested in helping us? Take a look at our patreon
| We would like to sincerely thank the following donors who helped fund the development of ESX. |
|---|
| Mohamad Buhamad - Michael Hein - RoadToSix - Montree Narathong |
| Saydoon - Muhannad alyamani - iSentrie - Wecity - Samuel Nicol |
| Kyle McShea - Artin - Mathias Christoffersen - Jaylan Yilmaz - Callum |
| CONGRESS KW - Michael Hein - Smery sitbon - daZepelin - CMF Community |
Description
Languages
JavaScript
62.3%
Lua
34.8%
TypeScript
1.2%
HTML
0.8%
CSS
0.7%
Other
0.2%