From 09d0e4c44a9fcd1e127c1679c166e471e0d1f003 Mon Sep 17 00:00:00 2001 From: Rafael Barreto Date: Fri, 22 Oct 2010 18:17:27 +0000 Subject: [PATCH] accuracy box fix (will not appear again when spectating), and sound spam fixed again git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5785 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/renderhud.cpp | 2 +- source/src/soundlocation.cpp | 9 ++++++--- source/src/weapon.cpp | 3 ++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/source/src/renderhud.cpp b/source/src/renderhud.cpp index a336714d..b5a4862c 100644 --- a/source/src/renderhud.cpp +++ b/source/src/renderhud.cpp @@ -775,7 +775,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat extern int tsens(int x); tsens(-2000); extern void r_accuracy(); - r_accuracy(); + if (!is_spect) r_accuracy(); if(!hideconsole) renderconsole(); if(showstats) { diff --git a/source/src/soundlocation.cpp b/source/src/soundlocation.cpp index 691b2561..480d758a 100644 --- a/source/src/soundlocation.cpp +++ b/source/src/soundlocation.cpp @@ -5,14 +5,17 @@ #define DEBUGCOND (audiodebug==1) VARP(gainscale, 1, 90, 100); -bool warn_about_unregistered_sound = true; +int warn_about_unregistered_sound = 0; location::location(int sound, const worldobjreference &r, int priority) : cfg(NULL), src(NULL), ref(NULL), stale(false), playmillis(0) { vector &sounds = (r.type==worldobjreference::WR_ENTITY ? mapsounds : gamesounds); if(!sounds.inrange(sound)) { - if (warn_about_unregistered_sound) conoutf("you have at least one unregistered sound: %d", sound); - warn_about_unregistered_sound = false; // warn just once... how people are able to have this issue?! + if (lastmillis - warn_about_unregistered_sound > 60 * 1000) // every minute + { + conoutf("you have at least one unregistered sound: %d", sound); + warn_about_unregistered_sound = lastmillis; + } stale = true; return; } diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index deed66da..362c1d86 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -613,11 +613,12 @@ void r_accuracy() if(i == GUN_CPISTOL || i == GUN_GRENADE || !accuracym[i].shots) continue; rows+=1; acc = 100.0f*(float)accuracym[i].hits/(float)accuracym[i].shots; - defformatstring(x)("\f0%s: \f5%.1f%s (%d/%d)",weapstr(i),acc,"%",accuracym[i].hits,accuracym[i].shots); + defformatstring(x)("\f5%5.1f%s (%3d/%3d) :\f0%s",acc,"%",accuracym[i].hits,accuracym[i].shots,weapstr(i)); cols=max(cols,(int)strlen(x)); lines.add(newstring(x)); } if(rows<1) return; + cols++; blendbox(x_offset, y_offset, spacing+x_offset+curfont->defaultw*cols, spacing+y_offset+curfont->defaulth*rows, true, -1); int x=0; loopv(lines)