Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
packet send hook can no longer return new packet
- Loading branch information
Showing
3 changed files
with
10 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4cd17fd
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.
but why not? i was scratching my head over this for a long time because the docs still say that "can return false, newpacket" dang
4cd17fd
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.
I have a hunch it was related to the WorldPacket in core code being const. https://github.com/ElunaLuaEngine/ElunaTrinityWotlk/blob/25fd1d1991743baaf3be1407b98db2617279361c/src/server/game/Server/WorldSession.cpp#L209
You can try to send a new packet anyways and it would work just fine - I believe,
I guess the documentation should be changed then if it still says it can return new packet. I also see some other things that should be changed with these hooks, need to take a look at them later.
4cd17fd
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.
Thanks for the quick reply :)
yeah , i did just that and it worked fine at least in TC-3.3.5, just have to add a variable to skip the hook before sending to not make a infinite loop
https://github.com/anzz1/ElunaLuaScripts/blob/main/fix_custom_trainers.lua