From 55b4bf1d6dbe1b587a3cf00d98195c1a97a48627 Mon Sep 17 00:00:00 2001 From: arghvark Date: Fri, 24 Mar 2006 21:29:54 +0000 Subject: [PATCH] cleaned up hud issues with nade git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@233 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/renderextras.cpp | 12 +++++++++--- source/src/weapon.cpp | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/source/src/renderextras.cpp b/source/src/renderextras.cpp index 864c58de..1d404349 100644 --- a/source/src/renderextras.cpp +++ b/source/src/renderextras.cpp @@ -397,7 +397,9 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat { //draw_textf("%d", 690, 827, 2, player1->mag[player1->gunselect]); char gunstats [64]; - sprintf(gunstats,"%i/%i",player1->mag[player1->gunselect],player1->ammo[player1->gunselect]); + if (player1->gunselect!=GUN_GRENADE) + sprintf(gunstats,"%i/%i",player1->mag[player1->gunselect],player1->ammo[player1->gunselect]); + else sprintf(gunstats,"%i",player1->mag[player1->gunselect]); draw_text(gunstats, 690, 827, 2); //clean up pointer? //delete gunstats; @@ -429,8 +431,12 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat drawicon((float)(g*64), (float)r, 1220, 1650); glDisable(GL_BLEND); } - else drawicon((float)(g*64), (float)r, 1220, 1650); - glPopMatrix(); + else + { + if (player1->gunselect==GUN_GRENADE) drawicon(0, 0, 1220, 1650); + else drawicon((float)(g*64), (float)r, 1220, 1650); + } + glPopMatrix(); }; glDisable(GL_BLEND); diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 862104d7..81b83624 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -86,7 +86,7 @@ COMMAND(wdw,ARG_NONE); void reload() { - if(player1->gunselect==GUN_KNIFE) return; + if(player1->gunselect==GUN_KNIFE || player1->gunselect==GUN_GRENADE) return; if(player1->mag[player1->gunselect]>=guns[player1->gunselect].magsize) return; if(player1->ammo[player1->gunselect]<=0) return; if(player1->reloading) return;