Lowered break chance for items.
This commit is contained in:
@@ -12,7 +12,7 @@ bool is_daytime = true;
|
||||
bool sun_setting_warned = false;
|
||||
bool sunrise_warned = false;
|
||||
|
||||
int playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
float playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
int playerItemBreaksToday = 0;
|
||||
bool playerItemBreakPending = false;
|
||||
int playerItemBreakPendingType = -1;
|
||||
@@ -124,7 +124,8 @@ void attempt_player_item_break_check() {
|
||||
if (breakableItems.length() == 0) return;
|
||||
|
||||
int roll = random(1, 100);
|
||||
if (roll <= playerItemBreakChance) {
|
||||
int checkChance = int(playerItemBreakChance); // Floor for comparison
|
||||
if (roll <= checkChance) {
|
||||
int pickIndex = random(0, int(breakableItems.length()) - 1);
|
||||
int itemType = breakableItems[pickIndex];
|
||||
playerItemBreakChance = PLAYER_ITEM_BREAK_CHANCE_MIN;
|
||||
|
||||
Reference in New Issue
Block a user