Skip to content

Commit

Permalink
Fix off-by-one error when calculating loot drop rates.
Browse files Browse the repository at this point in the history
  • Loading branch information
dorkster committed Sep 17, 2018
1 parent b1835d5 commit 2243b50
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE_NOTES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Engine fixes:
* Re-create render context when "ignore_texture_filter" setting changes.
* Fixed bug where points spent on passive powers would be de-allocated after dying.
* Prevent upgrading powers with the '+' button while the player is dead.
* Fix off-by-one error when calculating loot drop rates.

Translation updates:

Expand Down
2 changes: 1 addition & 1 deletion src/LootManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ void LootManager::checkLoot(std::vector<EventComponent> &loot_table, FPoint *pos
ItemStack new_loot;
std::vector<EventComponent*> possible_ids;

int chance = rand() % 100;
int chance = Math::randBetween(1,100);

// first drop any 'fixed' (0% chance) items
for (size_t i = loot_table.size(); i > 0; i--) {
Expand Down
2 changes: 1 addition & 1 deletion src/Version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ FLARE. If not, see https://www.gnu.org/licenses/

#include <SDL.h>

Version VersionInfo::ENGINE(1, 7, 3);
Version VersionInfo::ENGINE(1, 7, 4);
Version VersionInfo::MIN(0, 0, 0);
Version VersionInfo::MAX(USHRT_MAX, USHRT_MAX, USHRT_MAX);

Expand Down

0 comments on commit 2243b50

Please sign in to comment.