Open youtastelikerottencorpse opened 8 months ago
This is because MTA does not actually destroy objects/vehicles/peds when we call destroyElement. destroyElement marks an element with the "being deleted" flag, puts it on the "delete on next tick" list, and removes it from the element list. engineFreeModel scans the element list and changes the affected model ID to a safe parent ID.
Describe the bug
After an element with custom id is destroyed, calling
engineFreeModel
within the same frame of destroy is causing a crashIf custom id don't have custom dff or txd, game isn't crashing
Steps to reproduce
Either:
Use
engineFreeModel
right after an element with custom id destroyed usingonClientElementDestroy
or use test resource
efm:
seecrash_producers.lua
for allefm:createvehicle
commandefm:replacemodel
command (no crash happens if this step is skipped)efm:crash
to crash it (no crash happens iftestveh
is streamed out)Version
Client: v1.6-release-22388 (Windows 10, x64) Server: localhost, same
Additional context
engineFreeModel
is called before the element is destroyed, game doesn't crash There are more findings incrash_producers.lua
, you can take a look at it. Not sure if this is allIf you are a scripter reading this and having crashes related to your custom models (or if you thinking so), to prevent the bug, put a 50ms delay to your
engineFreeModel
call. Can't promise it will fix :^)Relevant log output
No response
Security Policy