From a4b83ef2ba5fcb8ef38fb9d542f7f21ed496d5ec Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Thu, 14 Apr 2011 15:24:11 +0000 Subject: [PATCH] warning fixes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6248 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/audiomanager.cpp | 3 --- source/src/bot/ac_bot_ai.cpp | 3 +-- source/src/clientgame.cpp | 4 ++-- source/src/clients2c.cpp | 6 +++--- source/src/entity.h | 3 +-- source/src/serverchecks.h | 4 +--- source/src/weapon.cpp | 2 -- 7 files changed, 8 insertions(+), 17 deletions(-) diff --git a/source/src/audiomanager.cpp b/source/src/audiomanager.cpp index c5d132b6..83900c14 100644 --- a/source/src/audiomanager.cpp +++ b/source/src/audiomanager.cpp @@ -296,7 +296,6 @@ void audiomanager::updateplayerfootsteps(playerent *p) if(!p) return; const int footstepradius = 20; - static float lastoffset = 0; // find existing footstep sounds physentreference ref(p); @@ -319,8 +318,6 @@ void audiomanager::updateplayerfootsteps(playerent *p) location *l = locs[i]; if(!l) continue; if(l->playmillis+minplaytime>totalmillis) continue; // tolerate short interruptions by enforcing a minimal playtime - lastoffset = l->offset(); // save last offset - DEBUGVAR(lastoffset); l->drop(); } } diff --git a/source/src/bot/ac_bot_ai.cpp b/source/src/bot/ac_bot_ai.cpp index 980e9113..65eb0d99 100644 --- a/source/src/bot/ac_bot_ai.cpp +++ b/source/src/bot/ac_bot_ai.cpp @@ -102,7 +102,7 @@ entity *CACBot::SearchForEnts(bool bUseWPs, float flRange, float flMaxHeight) - distance */ - float flNearestDist = 9999, flDist; + float flDist; entity *pNewTargetEnt = NULL; waypoint_s *pWptNearBot = NULL, *pBestWpt = NULL; short sScore, sHighestScore = 0; @@ -216,7 +216,6 @@ entity *CACBot::SearchForEnts(bool bUseWPs, float flRange, float flMaxHeight) pBestWpt = NULL; // Best ent so far doesn't need any waypoints sHighestScore = sScore; - flNearestDist = flDist; pNewTargetEnt = &ents[i]; } } diff --git a/source/src/clientgame.cpp b/source/src/clientgame.cpp index 0739c728..7bb3839e 100644 --- a/source/src/clientgame.cpp +++ b/source/src/clientgame.cpp @@ -709,8 +709,8 @@ void setkillmessage(int gun, bool gib, const char *message) return; } - if(gib) formatstring(gibmessages[gun])("%s", message); - else formatstring(fragmessages[gun])("%s", message); + if(gib) copystring(gibmessages[gun], message, sizeof(gibmessages[gun])); + else copystring(fragmessages[gun], message, sizeof(fragmessages[gun])); } void fragmessage(const char *gun, const char *message) diff --git a/source/src/clients2c.cpp b/source/src/clients2c.cpp index dff4a8f1..4662fd29 100644 --- a/source/src/clients2c.cpp +++ b/source/src/clients2c.cpp @@ -118,7 +118,7 @@ void parsepositions(ucharbuf &p) int cn, f, g; vec o, vel; float yaw, pitch, roll = 0; - bool scoping, shoot; + bool scoping;//, shoot; if(type == SV_POSC) { bitbuf q(p); @@ -146,7 +146,7 @@ void parsepositions(ucharbuf &p) if(negz) z = -z; o.z = z / DMF; scoping = ( q.getbits(1) ? true : false ); - shoot = ( q.getbits(1) ? true : false ); + q.getbits(1);//shoot = ( q.getbits(1) ? true : false ); } else { @@ -162,7 +162,7 @@ void parsepositions(ucharbuf &p) if ((g>>1) & 1) vel.y = getint(p)/DVELF; else vel.y = 0; if ((g>>2) & 1) vel.z = getint(p)/DVELF; else vel.z = 0; scoping = ( (g>>4) & 1 ? true : false ); - shoot = ( (g>>5) & 1 ? true : false ); // we are not using this yet + //shoot = ( (g>>5) & 1 ? true : false ); // we are not using this yet f = getuint(p); } int seqcolor = (f>>6)&1; diff --git a/source/src/entity.h b/source/src/entity.h index f042dd2b..54123534 100644 --- a/source/src/entity.h +++ b/source/src/entity.h @@ -617,11 +617,10 @@ struct medalsst {bool assigned; int cn; int item;}; #define MAXKILLMSGLEN 16 extern char fragmessages[NUMGUNS][MAXKILLMSGLEN]; extern char gibmessages[NUMGUNS][MAXKILLMSGLEN]; - inline const char *killmessage(int gun, bool gib = false) { if(gun<0 || gun>=NUMGUNS) return ""; if(gib) return gibmessages[gun]; else return fragmessages[gun]; -} \ No newline at end of file +} diff --git a/source/src/serverchecks.h b/source/src/serverchecks.h index 25a2afed..2fc9e061 100644 --- a/source/src/serverchecks.h +++ b/source/src/serverchecks.h @@ -34,7 +34,7 @@ inline void checkclientpos(client *cl) int getmaxarea(int inversed_x, int inversed_y, int transposed, int ml_factor, char *ml) { int ls = (1 << ml_factor); - int xi = 0, oxi = 0, xf = 0, oxf = 0, yi = 0, yf = 0, fx = 0, fy = 0; + int xi = 0, oxi = 0, xf = 0, oxf = 0, fx = 0, fy = 0; int area = 0, maxarea = 0; bool sav_x = false, sav_y = false; @@ -65,7 +65,6 @@ int getmaxarea(int inversed_x, int inversed_y, int transposed, int ml_factor, ch if ( sav_y ) { // if the last line was saved if ( 2*oxi + MINELINE < 2*xf && 2*xi + MINELINE < 2*oxf ) { // if the last line intersect this one - yf = y; // new end of area area += xf - xi; } else { oxi = xi; // new area vertices @@ -75,7 +74,6 @@ int getmaxarea(int inversed_x, int inversed_y, int transposed, int ml_factor, ch else { oxi = xi; oxf = xf; - yi = y; // new begin of area sav_y = true; // accumulating lines from now } } else { diff --git a/source/src/weapon.cpp b/source/src/weapon.cpp index 9905c5a7..41ee8c78 100644 --- a/source/src/weapon.cpp +++ b/source/src/weapon.cpp @@ -157,11 +157,9 @@ void createrays(vec &from, vec &to) // create random spread of rays for the shot spoke.orthogonal(dir); spoke.normalize(); spoke.mul(f); - int circseg = -1; loopk(3) loopi(SGRAYS) { - circseg = k; int j = k * SGRAYS; sgr[j+i].ds = k==0 ? SGSEGDMG_O : (k==1? SGSEGDMG_M: SGSEGDMG_C); vec p(spoke);