Skip to content
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

Core: Trigger OnSave hook for PlayerScript #11627

Merged
merged 2 commits into from Mar 9, 2014

Conversation

Rochet2
Copy link
Contributor

@Rochet2 Rochet2 commented Feb 19, 2014

OnSave is not triggered anywhere.
This adds the call to the SaveToDB function for player.

Unsure if should be triggered elsewhere as well :)

@jackpoz
Copy link
Member

jackpoz commented Feb 19, 2014

@Rochet2
Copy link
Contributor Author

Rochet2 commented Feb 19, 2014

Hmm, I see.
: |
I feel a bit sad that its there though, and not in the actual save function.
So its not triggered for example if .save is used and many other occasions where the hook would actually be used. (Every time the player is saved)

Modified it to remove the original hook call.
This way its called every time the player is actually saved to DB.

@jackpoz
Copy link
Member

jackpoz commented Feb 19, 2014

is it called even when the player is created ?

@Rochet2
Copy link
Contributor Author

Rochet2 commented Feb 19, 2014

Yes, since it doesnt check for the create flag.
could use if (!create) // call hook
if you dont like that.

@Warpten
Copy link
Member

Warpten commented Mar 9, 2014

Would be better to not save on player creation

Dont trigger save hook on player create
@Rochet2
Copy link
Contributor Author

Rochet2 commented Mar 9, 2014

Anything to get this through : |

@Warpten
Copy link
Member

Warpten commented Mar 9, 2014

Lol, i could be an asshole and ask you to squash these into one commit ... But i won't :p

Warpten added a commit that referenced this pull request Mar 9, 2014
Core/Players: Call sScriptMgr::OnPlayerSave inside Player::SaveToDB rather than before calling it.
@Warpten Warpten merged commit d4416c0 into TrinityCore:master Mar 9, 2014
@Rochet2
Copy link
Contributor Author

Rochet2 commented Mar 9, 2014

Lol, i could be an asshole and ask you to squash these into one commit ... But i won't :p

I was kinda waiting for that, but thanks ;)

@Rochet2 Rochet2 deleted the OnPlayerSave branch March 9, 2014 20:57
raczman pushed a commit to raczman/TrinityCore that referenced this pull request Apr 20, 2014
Core/Players: Call sScriptMgr::OnPlayerSave inside Player::SaveToDB rather than before calling it.
lfxgroove pushed a commit to lfxgroove/server that referenced this pull request Sep 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants