Skip to content

Commit

Permalink
fix fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
notV4l committed Sep 21, 2023
1 parent dc2869e commit 4471e34
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/constants.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@ const PRICE_VAR_MIN: u8 = 1; // 1%
const PRICE_VAR_MAX: u8 = 5; // 5%

// market price events
const MARKET_EVENT_CHANCE: u8 = 2; // 2% = 1% up / 1% down
const MARKET_EVENT_CHANCE: u8 = 1; // 2% = 1% up / 1% down
const MARKET_EVENT_MIN: u8 = 50; // 50%
const MARKET_EVENT_MAX: u8 = 100; // 100%
4 changes: 2 additions & 2 deletions src/systems/travel.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ fn market_variations(ctx: Context, game_id: u32) {
price_variation_with_cash(
ctx, game_id, *location_id, *drug_id, ref seed, false
);
} else if rand > 50 && rand < 50 + MARKET_EVENT_CHANCE.into() {
} else if rand > 50 && rand <= 50 + MARKET_EVENT_CHANCE.into() {
// big move up
price_variation_with_drug(
ctx, game_id, *location_id, *drug_id, ref seed, true
Expand All @@ -139,7 +139,7 @@ fn market_variations(ctx: Context, game_id: u32) {
increase: true
}
);
} else if rand < 50 && rand > 50 - MARKET_EVENT_CHANCE.into() {
} else if rand < 50 && rand >= 50 - MARKET_EVENT_CHANCE.into() {
// big move down
price_variation_with_drug(
ctx, game_id, *location_id, *drug_id, ref seed, false
Expand Down

0 comments on commit 4471e34

Please sign in to comment.