Skip to content

Commit

Permalink
game: Implement g_noFlight cvar. An option to disable/enable flight i…
Browse files Browse the repository at this point in the history
…n the server
  • Loading branch information
LegendaryGuard committed Feb 5, 2024
1 parent ef01d5a commit 7cfb3af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions docs/bfp_cvars_task.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@
- [x] ~~cg_lightweightAuras~~
- [x] ~~cg_polygonAura~~
- [x] ~~cg_highPolyAura~~
- [x] ~~g_noFlight (disables "fly" bind too, original BFP has a leak though)~~

#### Cvar Gametypes:

Expand Down
5 changes: 5 additions & 0 deletions source/game/g_cmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -1597,6 +1597,11 @@ Cmd_BFP_Fly_f
*/
void Cmd_BFP_Fly_f( gentity_t* ent ) { // BFP - Flight

// BFP - No flight
if ( g_noFlight.integer > 0 ) {
return;
}

if ( ent->client->ps.pm_type != PM_DEAD ) {
// do not play the sound in the charging status
if ( !( ent->client->ps.pm_flags & PMF_FLYING ) && !( ent->client->ps.pm_flags & PMF_KI_CHARGE ) ) {
Expand Down
2 changes: 1 addition & 1 deletion source/game/g_cvar.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ G_CVAR( g_meleeRange, "g_meleeRange", "32", 0, 0, qtrue ) // BFP - Melee range
G_CVAR( g_chargeDelay, "g_chargeDelay", "750", 0, 0, qtrue ) // BFP - Charge delay
G_CVAR( g_hitStun, "g_hitStun", "", 0, 0, qtrue ) // BFP - Hit stun
G_CVAR( g_meleeOnly, "g_meleeOnly", "", 0, 0, qtrue ) // BFP - Melee only
G_CVAR( g_noFlight, "g_noFlight", "", 0, 0, qtrue ) // BFP - No flight
G_CVAR( g_noFlight, "g_noFlight", "0", CVAR_SERVERINFO | CVAR_USERINFO | CVAR_LATCH, 0, qtrue ) // BFP - No flight
G_CVAR( g_plKillBonusPct, "g_plKillBonusPct", ".1", 0, 0, qtrue ) // BFP - Kill bonus percentage
G_CVAR( g_maxSpawnPL, "g_maxSpawnPL", "999", 0, 0, qtrue ) // BFP - Max spawn powerlevel
G_CVAR( g_flightCost, "g_flightCost", "50", 0, 0, qtrue ) // BFP - Flight cost
Expand Down

0 comments on commit 7cfb3af

Please sign in to comment.