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

only update zeny achievements and logs for non-zero transactions #2227

Merged
merged 1 commit into from
Oct 7, 2018

Conversation

Helianthella
Copy link
Member

Pull Request Prelude

Changes Proposed

When a player does a zeny transaction, achievement_validate_zeny is called to see if the transaction triggered the completion of an achievement objective, but this function expects z < 0 || z > 0, so we should either remove the non-zero assert or only call it when we have a non-zero zeny transaction.

This PR fixes http://herc.ws/board/topic/16336--

@Helianthella Helianthella added the type:bug Issue is a bug or describes an incorrect behavior that should be fixed label Sep 28, 2018
@HerculesWSAPI
Copy link
Contributor

This change is Reviewable

@Helianthella Helianthella added this to the Release v2018.10.21 milestone Sep 28, 2018
@Helianthella Helianthella changed the base branch from stable to master September 28, 2018 21:29
Copy link
Contributor

@4144 4144 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pr look like correct, but probably better change direct message strings to strings from messages.conf

@@ -4506,14 +4506,15 @@ static int pc_payzeny(struct map_session_data *sd, int zeny, enum e_log_pick_typ
sd->status.zeny -= zeny;
clif->updatestatus(sd,SP_ZENY);

achievement->validate_zeny(sd, -zeny); // Achievements [Smokexyz/Hercules]
if (zeny > 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if it's 0, do we even need to process above functions?
particularly:

sd->status.zeny -= zeny;
clif->updatestatus(sd,SP_ZENY);

Copy link
Member Author

@Helianthella Helianthella Oct 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

someone might want to do Zeny += 0; from a script to force Hercules to send the zeny update packet to the client in case of desync

@MishimaHaruna MishimaHaruna merged commit 75cd42c into HerculesWS:master Oct 7, 2018
@Helianthella Helianthella deleted the validatezeny branch October 7, 2018 14:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Issue is a bug or describes an incorrect behavior that should be fixed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants