-
Notifications
You must be signed in to change notification settings - Fork 36
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
Make IDs easier to edit #45
base: master
Are you sure you want to change the base?
Conversation
|
||
// Offsets from creatures_objects.sql | ||
constexpr uint32 GetCreatureEntry(uint32 offset) { | ||
return 500030 + offset; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, but what if I set @C_TEMPLATE = 40050, then everything would break.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as before.
But now you can easily change it in this one (four) place(s).
If you change it in SQL script, you need to change it here too.
But atleast there are only 4 places to change, instead of two dozen as before
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well then put it into the config. Hardcoded stuff are bad.
I tried to make modifications and solve the conflicts, but when it comes to make the push, I find that I don't have permissions to upload the changes. If you could enable those permissions, I would push the changes. @dedmen |
Huh weird the checkbox isn't present to allow access to maintainers. I just checked for changes here 3 days ago :D |
From the mobile phone, when I want to open the invitation, it gives me a 404 error. However, I will try from the PC. It's strange, usually, they don't have to invite me. Simply modifying the permissions in the fork settings is usually enough. I have to check if, in addition to solving the conflict, I don't have to make one more change. Because I was not sure if when editing a SQL file, a new hash was created and executed again. Yesterday I confirmed that, and I saw that it does. But without knowing it, I created a third file. After I upload the changes, I will have to test the branch and verify that everything is fine. |
The conflict is resolved, but I think some suggestions about codes or new hardcore are missing. |
I think the changes are compatible, but we still need to review the hardcore numbers part. |
The hardcoded numbers will also get worse when we add SQL patches, like we did with the previous PR you merged. Maybe we could store the "base number" in the database, some table. But that's a quite bigger change. I didn't want to provide a full solution here, I just wanted to make it a bit easier (edit 4 places instead of over 20), and the better solution can be done later (more easily because I already did half of it). Also the way I did it with the constexpr function, means the value needs to be present at compile-time, so putting it into config file isn't possible that way. But it solved my use case as I compile from source with edited ID's (which you already had to do previously) |
If you can't edit it, from the configuration file, then bye-bye to the solution I wanted to give you... |
If you remove constexpr it fails to compile. Of course can make that not be a switch and instead some different runtime dispatch. But that would be a bigger rework there too that I didn't want to go down to. Maybe I'd have some time soon-ish to do just that. But probably would be a couple weeks to get to it. |
I leave you the updated branch then, the module compiles and works, when you have time to check it, welcome. |
What this person did, doesn't it work, or is it complementary to what you want to do: #39. |
#39 is completely unrelated to my thing. |
if no objections, I would merge this, it improves the code quality |
In case you need to edit the Entity/GameObject ID's it can now be done in just 4 places.
Instead of in two dozen