evangipson / evangipson/microstocks
Stocks can have negative values and buying them increases your cash
Open
backend
bug
- Dominant language
- JavaScript
- Stars
- 1
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
It doesn't happen everytime, but on my game i had VOD at -$1 and i bought 100 shares and my cash went up by 100, i gained 100 shares of VOD, and VOD went to $0.
You probably are just missing an abs() somewhere in your code.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reproducing the negative-stock-price case in the game, then trace the stock purchase and cash-update logic. Confirm the behavior around VOD at -$1 and buying 100 shares. Done means stock values do not produce a cash increase when shares are bought, and the transaction leaves the stock at the expected value.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100