Drugwars frontent was showing too low balances wrt to the Operation Center level

in #utopian-io5 years ago


Source: drugwars.io repository

Project Information

The drugwars API provides the resource production rates, the building levels as well as the resource balances together with a timestamp of the last update. The frontend then calculates the current balances based on the balances at the time of the last update plus the production rate and the level of the Operation Center building. Each level of the Operation Center building increases the resource production rates by 0.5%.

Expected behavior

The Operation Center bonus ("+0.5% Income per Level") should be added to the shown balances based on the balance at the last update, the production rate and the OC level.

Actual behavior

A fixed 1x 0.5% bonus was added if the Operation Center level was greater than 0, plus 0.005 drugs/weapons/alcohol per level (absolute units, not percent).

How to reproduce

See the code, details in the Github issue.

History/Fix

I have created a Github Issue here together with a possible fix. The issue was then fixed by hightouch with commits 8220cb4 + e2c3f40.

GitHub Account

https://github.com/crokkon

Sort:  

Thanks for your contribution @stmdev

Your contribution was easy to understand and although not something you can show with steps to reproduce in an easy manner, I think providing a code link was a good choice.

The issue was resolved and I can see that your comments were useful in the overall resolution, nice work.

Overall, a nice and simple resolution to an issue that could have easily gone missed. Good work.

Thanks again for your contribution and look forward to seeing more from you soon.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Chat with us on Discord.

[utopian-moderator]

Thank you for your review, @tobias-g! Keep up the good work!

Hi @stmdev!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @stmdev!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!