Prevents kill achievments from being granted on first hit.

This commit is contained in:
Linus Probert 2018-09-03 20:27:34 +02:00
parent a19a13e054
commit 280b073a8c
1 changed files with 13 additions and 14 deletions

View File

@ -512,6 +512,14 @@ player_monster_kill_check(Player *player, Monster *monster)
if (!monster)
return;
if (monster->stats.hp <= 0) {
unsigned int gained_xp = 5 * monster->stats.lvl;
player->stat_data.kills += 1;
mixer_play_effect(DEATH);
gui_log("You killed %s and gained %d xp",
monster->lclabel, gained_xp);
player_gain_xp(player, gained_xp);
#ifdef STEAM_BUILD
if (strcmp("The Shadow", monster->label) == 0)
steam_set_achievement(LIGHTS_ON);
@ -523,16 +531,7 @@ player_monster_kill_check(Player *player, Monster *monster)
steam_set_achievement(THE_DOCTOR_IS_OUT);
else if (strcmp("Linus, the Developer", monster->label) == 0)
steam_set_achievement(BUGGFIXER);
#endif // STEAM_BUILD
if (monster->stats.hp <= 0) {
unsigned int gained_xp = 5 * monster->stats.lvl;
player->stat_data.kills += 1;
mixer_play_effect(DEATH);
gui_log("You killed %s and gained %d xp",
monster->lclabel, gained_xp);
player_gain_xp(player, gained_xp);
}
}