From 09a43565940be30b233fa8730e65d531a454a03b Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 21 Jul 2025 06:06:50 +0200 Subject: Cleaned 95% of -Wall -Wextra... --- src/fpsgame/ai.cpp | 3 +-- src/fpsgame/entities.cpp | 30 +++++++++++++++++++----------- src/fpsgame/game.h | 10 +++++----- src/fpsgame/server.cpp | 3 ++- 4 files changed, 27 insertions(+), 19 deletions(-) (limited to 'src/fpsgame') diff --git a/src/fpsgame/ai.cpp b/src/fpsgame/ai.cpp index 50f0549..a4d3c33 100644 --- a/src/fpsgame/ai.cpp +++ b/src/fpsgame/ai.cpp @@ -877,10 +877,9 @@ namespace ai switch(wpspot(d, d->ai->route[n], true)) { case 2: d->ai->clear(false); + [[fallthrough]]; case 1: return true; // not close enough to pop it yet - case 0: - default: break; } } diff --git a/src/fpsgame/entities.cpp b/src/fpsgame/entities.cpp index 3403c2e..63d35d0 100644 --- a/src/fpsgame/entities.cpp +++ b/src/fpsgame/entities.cpp @@ -77,30 +77,30 @@ namespace entities switch(i) { case I_SHELLS: - + [[fallthrough]]; case I_BULLETS: - + [[fallthrough]]; case I_ROCKETS: - + [[fallthrough]]; case I_ROUNDS: - + [[fallthrough]]; case I_GRENADES: - + [[fallthrough]]; case I_CARTRIDGES: if(m_noammo) continue; break; case I_HEALTH: - + [[fallthrough]]; case I_BOOST: - + [[fallthrough]]; case I_TINYHEALTH: - + [[fallthrough]]; case I_TINYARMOUR: - + [[fallthrough]]; case I_GREENARMOUR: - + [[fallthrough]]; case I_YELLOWARMOUR: - + [[fallthrough]]; case I_QUAD: if(m_noitems) continue; break; @@ -116,6 +116,7 @@ namespace entities { case TELEPORT: if(e.attr2 > 0) preloadmodel(mapmodelname(e.attr2)); + [[fallthrough]]; case JUMPPAD: if(e.attr4 > 0) preloadmapsound(e.attr4); @@ -394,6 +395,13 @@ namespace entities { switch(e.type) { + case TELEDEST: + { + vec dir; + vecfromyawpitch(e.attr1, 0, 1, 0, dir); + renderentarrow(e, dir, 4); + break; + } case TELEPORT: loopv(ents) if(ents[i]->type == TELEDEST && e.attr1==ents[i]->attr2) { diff --git a/src/fpsgame/game.h b/src/fpsgame/game.h index df0eeb5..3ab0447 100644 --- a/src/fpsgame/game.h +++ b/src/fpsgame/game.h @@ -313,9 +313,9 @@ struct fpsstate case I_HEALTH: return healthroundTripTime + peer->roundTripTimeVariance : ENET_PEER_DEFAULT_ROUND_TRIP_TIME); + return PUSHMILLIS + ((peer) ? (int) (peer->roundTripTime + peer->roundTripTimeVariance) : (int) ENET_PEER_DEFAULT_ROUND_TRIP_TIME); } bool checkpushed(int millis, int range) @@ -535,6 +535,7 @@ namespace server case '!': mode++; if(mode[0] != '?') break; + [[fallthrough]]; case '?': mode++; loopk(NUMGAMEMODES) if(searchmodename(gamemodes[k].name, mode)) -- cgit v1.2.3