-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Invalid id under OnDynamicObjectMoved/OnPlayerEnterDynamicArea with Streamer_GetIntData #98
Comments
The only reason you'd get that message is if the object or area just doesn't exist. I'd try paying attention to which IDs are causing the problem and seeing if there's any kind of pattern behind it. |
I know that the reason of those errors is that they don't exist. But this shouldn't happen in those callbacks, as those IDs have to be valid for the callbacks to be called. I have lots of movable objects and areas. I don't know how to reproduce it, I asked maybe if someone else has/had this problem. Those callbacks shouldn't be called at all if those IDs are actually invalid. |
Perhaps you're destroying objects and/or areas that are referenced almost immediately afterwards in those callbacks. Actually, looking at the code again, I don't even see any validity checks for the objects or areas before those callbacks are executed, so that does seem to be the problem. I'll fix this soon. |
No, I don't. I checked where I remove the object/area under those callbacks, but I saw that immediately after I delete them I return 1, so it won't continue to the rest of the callback for that id. Even if there aren't sanity checks, that still shouldn't happen, it's weird that it happens to invalid IDs. |
No, I mean you could destroy an object or area under one of those callbacks, and then the same callback could be called again for an ID that no longer exists because you had just destroyed it earlier. The callbacks in the plugin aren't executed immediately after an object is moved or a player enters or leaves an area. (What if the script decides to destroy objects or areas under a callback in the middle of the streaming process? That would invalidate iterators and cause a crash.) Instead, all of the information is placed in a few dynamic arrays and processed at the end of each update. Unfortunately, there aren't any sanity checks in place to ensure that the IDs still actually exist before the callbacks are executed, which is probably why you're seeing these error messages. |
Why I receive that error under those callbacks ? I mean, if I use the objectid/areaid as the id on Streamer_GetIntData, it should definitely exists in those callbacks, because an invalid object can't finish it's movement, because it doesn't exists, and you can't enter an invalid area. To fix this I have to use IsValidDynamicObject/Area. I don't know when this happens, it happens pretty randomly. Can anyone confirm this and specify when exactly this happens ?
(no debug mode, but it doesn't matter, it's how I described them)
The text was updated successfully, but these errors were encountered: