From a988df656b4d37dfa2472a4cde390185cfcea8b5 Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Tue, 2 Mar 2021 18:26:39 +0100 Subject: test foundation and functional reimplementation of cost function --- hud/hud_views.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'hud/hud_views.c') diff --git a/hud/hud_views.c b/hud/hud_views.c index b2192b3..385501e 100644 --- a/hud/hud_views.c +++ b/hud/hud_views.c @@ -72,6 +72,10 @@ void render_view_stats_unit (SDL_Renderer* rend, txtd *t, int px, int py, int n = stats_weapon_sprintf(info, u->weapon +i, arr); for (int i=0; icost_weights, u); + char s[64]; sprintf(s, "COST: %.2f", cost); + LABEL(px+pad, py+h, s, 1); h += 15; } @@ -84,7 +88,9 @@ void render_view_stats (SDL_Renderer* rend, txtd *t, int px, int py, stats_unit base; stats_unit_compute(info, tm, &base); - render_view_stats_unit(rend, t, px+10, py+h, info, &base); + if (tm->chassis != -1) { + render_view_stats_unit(rend, t, px+10, py+h, info, &base); + } } -- cgit v1.2.3-54-g00ecf