]> git.lizzy.rs Git - dungeon_game.git/commitdiff
Fix all hearts being rendered if player health <= 0
authorElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 9 Jun 2021 15:35:36 +0000 (17:35 +0200)
committerElias Fleckenstein <eliasfleckenstein@web.de>
Wed, 9 Jun 2021 15:35:36 +0000 (17:35 +0200)
plugins/game/game.c

index 74892c81f0c64f92166f6ae5a49e8d1b36896a70..0e734a06c6281ab707ad9a6c90679d05649c4e36 100644 (file)
@@ -332,7 +332,7 @@ static void render(render_entity_list entity_list)
        set_color((struct color) {255, 0, 0}, false);
 
        for (int i = 0; i < player.max_health; i++) {
-               if (i == player.health)
+               if (i >= player.health)
                        set_color(get_color("#5A5A5A"), false);
                printf("\u2665 ");
        }