Prevents artifacts before level 3
- Also fixes a potential segfault
This commit is contained in:
parent
8fa4fbd51c
commit
3fabd039a4
|
@ -96,7 +96,7 @@ artifact_create_random(Player *p, Uint8 level)
|
||||||
{
|
{
|
||||||
int option = -1;
|
int option = -1;
|
||||||
if (p->stats.lvl >= 4)
|
if (p->stats.lvl >= 4)
|
||||||
option = get_random(LAST_ARTIFACT_EFFECT);
|
option = get_random(LAST_ARTIFACT_EFFECT - 1);
|
||||||
else if (p->stats.lvl >= 3)
|
else if (p->stats.lvl >= 3)
|
||||||
option = get_random(INCREASED_STUN);
|
option = get_random(INCREASED_STUN);
|
||||||
else
|
else
|
||||||
|
|
|
@ -542,7 +542,7 @@ monster_drop_loot(Monster *monster, Map *map, Player *player)
|
||||||
linkedlist_append(&map->items, treasure);
|
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);
|
Artifact *a = artifact_create_random(player, 1);
|
||||||
a->sprite->pos = monster->sprite->pos;
|
a->sprite->pos = monster->sprite->pos;
|
||||||
linkedlist_append(&map->artifacts, a);
|
linkedlist_append(&map->artifacts, a);
|
||||||
|
|
Loading…
Reference in New Issue