Skip to content

Commit

Permalink
Prevents artifacts before level 3
Browse files Browse the repository at this point in the history
- Also fixes a potential segfault
  • Loading branch information
LiquidityC committed Aug 15, 2018
1 parent 8fa4fbd commit 3fabd03
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/artifact.c
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ artifact_create_random(Player *p, Uint8 level)
{
int option = -1;
if (p->stats.lvl >= 4)
option = get_random(LAST_ARTIFACT_EFFECT);
option = get_random(LAST_ARTIFACT_EFFECT - 1);
else if (p->stats.lvl >= 3)
option = get_random(INCREASED_STUN);
else
Expand Down
2 changes: 1 addition & 1 deletion src/monster.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ monster_drop_loot(Monster *monster, Map *map, Player *player)
linkedlist_append(&map->items, treasure);
}

if (get_random(19) == 0) {
if (monster->stats.lvl > 2 && get_random(19) == 0) {
Artifact *a = artifact_create_random(player, 1);
a->sprite->pos = monster->sprite->pos;
linkedlist_append(&map->artifacts, a);
Expand Down

0 comments on commit 3fabd03

Please sign in to comment.