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

Add Mana decay computation #1334

Closed

Conversation

Comment on lines +109 to +113
let mut epochs_to_decay = remaining_epochs;

if epochs_to_decay > 365 {
epochs_to_decay = 365
}

Choose a reason for hiding this comment

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

Suggested change
let mut epochs_to_decay = remaining_epochs;
if epochs_to_decay > 365 {
epochs_to_decay = 365
}
let epochs_to_decay = remaining_epochs.max(365);

Copy link

@DaughterOfMars DaughterOfMars Sep 29, 2023

Choose a reason for hiding this comment

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

or should this be using decay_factors.len()?

}

// combine both uint64 variables to get the actual value
value_hi << 32 + value_lo

Choose a reason for hiding this comment

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

Suggested change
value_hi << 32 + value_lo
value_hi << 32 | value_lo

Comment on lines +61 to +62
v = v << (64 - n);
v >> (64 - n)
Copy link

@DaughterOfMars DaughterOfMars Sep 29, 2023

Choose a reason for hiding this comment

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

Suggested change
v = v << (64 - n);
v >> (64 - n)
v & 0xFFFFFFFF

@thibault-martinez
Copy link
Member Author

Closing in favour of #1376

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.

2 participants