Skip to content

Core: Trigger OnSave hook for PlayerScript #11627

Merged
merged 2 commits into from Mar 9, 2014

3 participants

@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 :)

@Rochet2
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
TrinityCore member
jackpoz commented Feb 19, 2014

is it called even when the player is created ?

@Rochet2
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
TrinityCore member
Warpten commented Mar 9, 2014

Would be better to not save on player creation

@Rochet2 Rochet2 Update Player.cpp
Dont trigger save hook on player create
1f98435
@Rochet2
Rochet2 commented Mar 9, 2014

Anything to get this through : |

@Warpten
TrinityCore 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 Warpten merged commit d4416c0 into TrinityCore:master Mar 9, 2014
@Rochet2
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 Rochet2:OnPlayerSave branch Mar 9, 2014
@lfxgroove lfxgroove added a commit to lfxgroove/server that referenced this pull request Sep 7, 2014
@lfxgroove lfxgroove Backport of TrinityCore/TrinityCore#11627 3a3c1fa
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.