-
Notifications
You must be signed in to change notification settings - Fork 373
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Azerothcore] Object:SetInt32Value crashes the server when given a non-int value #435
Comments
I somewhat doubt this is eluna related really. The issue is that you try to use invalid addresses and values with the function that the core and client does not support. Based on this https://github.com/azerothcore/azerothcore-wotlk/blob/6b846df6a36e4ce72e9c26313d14aae70bad33e5/src/server/game/Entities/Object/Updates/UpdateFields.h#L25 |
Interesting. I'm not sure how I'm changing the player's GUID - I didn't even know that was possible, that seems like a read-only kinda variable to me! According to this: https://www.azerothcore.org/pages/eluna/Object/SetInt32Value.html the first parameter to Object:SetInt32Value() should be the index. I was assuming this was the index of a data structure stored on the object, and that you could store arbitrary integer values in it keyed to the index. I might be misunderstanding how SetInt32Value() works though. EDIT: The only script active currently is the example script shown above. |
Adding the reply here for completeness:
If you check the link I posted above, you can see the indexes of different fields. Its a bit of a treasure trove of fun things to try and do. For example once I tried that you can set the entry of a player to an elite NPC's entry using this field https://github.com/azerothcore/azerothcore-wotlk/blob/6b846df6a36e4ce72e9c26313d14aae70bad33e5/src/server/game/Entities/Object/Updates/UpdateFields.h#LL27C13-L27C13 |
Interesting! This is some neat functionality. I definitely misunderstood the function, and should have been using something like this: |
Here's a sample script:
If you change math.random() to an integer it works, but since math.random() gives a number between 0 and 1 (as in, not an integer) it crashes first the WoW client, then if you try to log back in it crashes the worldserver. Here are the error messages:
First, it crashes the WoW client with this error:
https://i.imgur.com/XbAnsXy.png (picture version)
Then when you try and log in again it again it crashes the server for good and displays this error message:
Obviously putting a non-int into an int function is unexpected and undesired behavior, dare I say it user error, but it might be useful to catch those kinds of exceptions for debugging purposes.
I'm using Azerothcore on Void Linux if it matters.
The text was updated successfully, but these errors were encountered: