summaryrefslogtreecommitdiff
path: root/src/fpsgame
diff options
context:
space:
mode:
authorxolatile2025-07-21 06:06:50 +0200
committerxolatile2025-07-21 06:06:50 +0200
commit09a43565940be30b233fa8730e65d531a454a03b (patch)
treee7ee95b2964b68611701643376ed500bb7d2ddcd /src/fpsgame
parent39de2c68c8a3f9cd7cffef9364a59c9d412b907e (diff)
downloadxolatile-badassbug-09a43565940be30b233fa8730e65d531a454a03b.tar.xz
xolatile-badassbug-09a43565940be30b233fa8730e65d531a454a03b.tar.zst
Cleaned 95% of -Wall -Wextra...
Diffstat (limited to 'src/fpsgame')
-rw-r--r--src/fpsgame/ai.cpp3
-rw-r--r--src/fpsgame/entities.cpp30
-rw-r--r--src/fpsgame/game.h10
-rw-r--r--src/fpsgame/server.cpp3
4 files changed, 27 insertions, 19 deletions
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 health<maxhealth;
case I_TINYARMOUR:
-
+ [[fallthrough]];
case I_GREENARMOUR:
-
+ [[fallthrough]];
case I_YELLOWARMOUR: return maxarmour<is.max || armour<maxarmour;
//~case I_TINYARMOUR:
@@ -344,14 +344,14 @@ struct fpsstate
//~break;
case I_BOOST:
maxhealth = min(maxhealth+is.info, is.max);
-
+ [[fallthrough]];
case I_HEALTH: // boost also adds to health
health = min(health+is.add, maxhealth);
break;
case I_TINYARMOUR:
-
+ [[fallthrough]];
case I_GREENARMOUR:
-
+ [[fallthrough]];
case I_YELLOWARMOUR:
maxarmour = max(maxarmour, is.max);
armour = min(armour+is.add, maxarmour);
diff --git a/src/fpsgame/server.cpp b/src/fpsgame/server.cpp
index be2b667..e085484 100644
--- a/src/fpsgame/server.cpp
+++ b/src/fpsgame/server.cpp
@@ -254,7 +254,7 @@ namespace server
int calcpushrange()
{
ENetPeer *peer = getclientpeer(ownernum);
- return PUSHMILLIS + (peer ? peer->roundTripTime + 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))