From 280b073a8c304b0be4d4d822c54716f90b28171d Mon Sep 17 00:00:00 2001 From: Linus Probert Date: Mon, 3 Sep 2018 20:27:34 +0200 Subject: [PATCH] Prevents kill achievments from being granted on first hit. --- src/player.c | 27 +++++++++++++-------------- 1 file changed, 13 insertions(+), 14 deletions(-) diff --git a/src/player.c b/src/player.c index afd60f8..8570061 100644 --- a/src/player.c +++ b/src/player.c @@ -512,20 +512,6 @@ player_monster_kill_check(Player *player, Monster *monster) if (!monster) return; -#ifdef STEAM_BUILD - if (strcmp("The Shadow", monster->label) == 0) - steam_set_achievement(LIGHTS_ON); - else if (strcmp("The Hell Hound", monster->label) == 0) - steam_set_achievement(BAD_DOG); - else if (strcmp("Platino", monster->label) == 0) - steam_set_achievement(DRAGON_SLAYER); - else if (strcmp("The Cleric", monster->label) == 0) - 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; @@ -533,6 +519,19 @@ player_monster_kill_check(Player *player, Monster *monster) 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); + else if (strcmp("The Hell Hound", monster->label) == 0) + steam_set_achievement(BAD_DOG); + else if (strcmp("Platino", monster->label) == 0) + steam_set_achievement(DRAGON_SLAYER); + else if (strcmp("The Cleric", monster->label) == 0) + steam_set_achievement(THE_DOCTOR_IS_OUT); + else if (strcmp("Linus, the Developer", monster->label) == 0) + steam_set_achievement(BUGGFIXER); +#endif // STEAM_BUILD } }