Selt 9a248406b0 fix(esx_lib/points): keep the points loop alive when a callback errors
Every point from every resource is served by one shared thread, and the enter, leave
and inside callbacks are all invoked bare. A Lua error in any one of them terminates
that coroutine, and nothing restarts it - startLoop only runs once, from the spawn
handler in es_extended.

So a single faulty third party resource takes down point detection for the whole
client. Shops, garages and job markers stop reacting, with no hint beyond one stack
trace, until the player reconnects.

inside is the worst of the three because it runs every frame while the player stands
in the point, so it is also dropped from insidePoints once it errors. Otherwise the
guard would turn a dead thread into a console flood at framerate. enter and leave only
fire on a transition, so they stay registered.

Measured in game on artifact 25770, with a healthy point, a point whose enter raises
and a point whose inside raises, all created while standing on them:

  before: the healthy point fired enter, then the broken one raised at points/client.lua
          and after that nothing happened at all - no leave when walking away, and
          points created afterwards never fired enter either, the thread was gone
  after:  both failures are logged against the owning point and resource, all three
          points fired leave when walking away, and points created afterwards worked
          normally. The inside failure printed once rather than every frame.

The runtime already prints the error and its stack, so the added line only names the
point and the resource it came from.
2026-07-27 17:19:40 +02:00
2025-07-28 11:38:03 +02:00
2025-10-01 22:16:13 -05:00
2026-05-25 12:12:51 +02:00

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

S
Description
Official Repo For core resources for esx-legacy
Readme 49 MiB
Languages
JavaScript 62.3%
Lua 34.8%
TypeScript 1.2%
HTML 0.8%
CSS 0.7%
Other 0.2%