Skip to content

Commit

Permalink
phase/inventory: fix health bar behavior
Browse files Browse the repository at this point in the history
Regression since converting inventory to a phase
  • Loading branch information
rr- committed Mar 24, 2024
1 parent 61c0674 commit df7ab2e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/game/inventory/inventory_ring.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ void Inv_Ring_Active(INVENTORY_ITEM *inv_item)

case O_MEDI_OPTION:
Overlay_BarSetHealthTimer(40);
Overlay_BarDrawHealth();
if (!g_InvItemText[IT_QTY] && qty > 1) {
sprintf(temp_text, "%d", qty);
Overlay_MakeAmmoString(temp_text);
Expand All @@ -252,7 +251,6 @@ void Inv_Ring_Active(INVENTORY_ITEM *inv_item)

case O_BIGMEDI_OPTION:
Overlay_BarSetHealthTimer(40);
Overlay_BarDrawHealth();
if (!g_InvItemText[IT_QTY] && qty > 1) {
sprintf(temp_text, "%d", qty);
Overlay_MakeAmmoString(temp_text);
Expand Down
12 changes: 12 additions & 0 deletions src/game/phase/phase_inventory.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "game/music.h"
#include "game/option.h"
#include "game/output.h"
#include "game/overlay.h"
#include "game/savegame.h"
#include "game/screen.h"
#include "game/shell.h"
Expand Down Expand Up @@ -111,6 +112,17 @@ static void Inv_Draw(RING_INFO *ring, IMOTION_INFO *motion)
}
}

INVENTORY_ITEM *inv_item = ring->list[ring->current_object];
switch (inv_item->object_number) {
case O_MEDI_OPTION:
case O_BIGMEDI_OPTION:
Overlay_BarDrawHealth();
break;

default:
break;
}

Matrix_Pop();
Viewport_SetFOV(old_fov);
}
Expand Down

0 comments on commit df7ab2e

Please sign in to comment.