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

fix: wrap stackable/charges items #944

Merged
merged 2 commits into from
Mar 21, 2023

Conversation

ElimarCosta
Copy link
Contributor

Description

Should be possible to wrap items with different amounts
Fixes bug introduced at #840 where casks were renewing charges after wrap/unwrap

Behaviour

Actual

Stackables were always being unwraped with a count of 255
Casks were renewing charges

Expected

Stackables should keep the amount after wrap/unwrap
Casks should keep the charges after wrap/unwrap

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@dudantas dudantas changed the title fix: wrap stackabled items fix: wrap stackable items Mar 21, 2023
@dudantas dudantas changed the title fix: wrap stackable items fix: wrap stackable/charges items Mar 21, 2023
@dudantas dudantas merged commit ce03bd2 into opentibiabr:main Mar 21, 2023
PeachieDude added a commit to PeachieDude/canary that referenced this pull request Mar 23, 2023
A discord user, Aerwix, found that plain rates for magic/skills from config werent working, after changing the rates the output was the same no matter what.

i acme to look and found out that it were using staged configuration even with the rateUseStages set to false.

After some tests using training/exercise weapons against a dummy and using weapons against monsters, even magic, twas confirmed that setting rateUseStages were using staged.

Found out that there was no verification for skills and magic.

did change the code and we ran more tests, got consistent results and got it working as intended.

Now when you set rateUseStages = false it will use the rate set in config.lua

Now when you set rateUseStages = true it will use the stages from stages.lua

All tests were made using a brand-new char for every test, just to be sure.
Tests made using training/exercise weapons against dummy with rateUseStages false and true, got expected results

Tests made using weapons against monsters with rateUseStages false and true, got expected results

Tests made using spells with rateUseStages false and true, got expected result

IMHO the code has space for improvement, i didnt like the if/else but twas what i got working, tried other way but wasnt able to make work w/o getting an error.

Feel free to discard the PR and bring a better version if so.

Missing only 2 commits by the time this pr is being proposed and the said prs wont affect the change. 

opentibiabr#944
opentibiabr#948
@PeachieDude PeachieDude mentioned this pull request Mar 23, 2023
8 tasks
luan pushed a commit that referenced this pull request Jul 11, 2023
Should be possible to wrap items with different amounts;
Fixes bug introduced at #840 where casks were renewing charges after wrap/unwrap.

Added new attribute "AMOUNT" to store quantity information (for stackable items)
@ElimarCosta ElimarCosta deleted the fix-wrap-stackable branch July 17, 2023 04:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants