]> de.git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - sv_main.c
fix more warnings
[xonotic/darkplaces.git] / sv_main.c
index 8218c30b84a03cf3763f6997cff1b32289e35141..8b192aaee508fb57fa97d77b89d5c5680a8887d3 100644 (file)
--- a/sv_main.c
+++ b/sv_main.c
@@ -47,8 +47,8 @@ cvar_t slowmo = {0, "slowmo", "1.0", "controls game speed, 0.5 is half speed, 2
 
 cvar_t sv_accelerate = {0, "sv_accelerate", "10", "rate at which a player accelerates to sv_maxspeed"};
 cvar_t sv_aim = {CVAR_SAVE, "sv_aim", "2", "maximum cosine angle for quake's vertical autoaim, a value above 1 completely disables the autoaim, quake used 0.93"};
-cvar_t sv_airaccel_qw = {0, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration"};
-cvar_t sv_airaccel_sideways_friction = {0, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging)"};
+cvar_t sv_airaccel_qw = {0, "sv_airaccel_qw", "1", "ratio of QW-style air control as opposed to simple acceleration; when < 0, the speed is clamped against the maximum allowed forward speed after the move"};
+cvar_t sv_airaccel_sideways_friction = {0, "sv_airaccel_sideways_friction", "", "anti-sideways movement stabilization (reduces speed gain when zigzagging); when < 0, only so much friction is applied that braking (by accelerating backwards) cannot be stronger"};
 cvar_t sv_airaccelerate = {0, "sv_airaccelerate", "-1", "rate at which a player accelerates to sv_maxairspeed while in the air, if less than 0 the sv_accelerate variable is used instead"};
 cvar_t sv_airstopaccelerate = {0, "sv_airstopaccelerate", "0", "when set, replacement for sv_airaccelerate when moving backwards"};
 cvar_t sv_airstrafeaccelerate = {0, "sv_airstrafeaccelerate", "0", "when set, replacement for sv_airaccelerate when just strafing"};
@@ -59,7 +59,7 @@ cvar_t sv_allowdownloads_archive = {0, "sv_allowdownloads_archive", "0", "whethe
 cvar_t sv_allowdownloads_config = {0, "sv_allowdownloads_config", "0", "whether to allow downloads of config files (cfg)"};
 cvar_t sv_allowdownloads_dlcache = {0, "sv_allowdownloads_dlcache", "0", "whether to allow downloads of dlcache files (dlcache/)"};
 cvar_t sv_allowdownloads_inarchive = {0, "sv_allowdownloads_inarchive", "0", "whether to allow downloads from archives (pak/pk3)"};
-cvar_t sv_areagrid_mingridsize = {CVAR_NOTIFY, "sv_areagrid_mingridsize", "128", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"};
+cvar_t sv_areagrid_mingridsize = {CVAR_NOTIFY, "sv_areagrid_mingridsize", "64", "minimum areagrid cell size, smaller values work better for lots of small objects, higher values for large objects"};
 cvar_t sv_checkforpacketsduringsleep = {0, "sv_checkforpacketsduringsleep", "0", "uses select() function to wait between frames which can be interrupted by packets being received, instead of Sleep()/usleep()/SDL_Sleep() functions which do not check for packets"};
 cvar_t sv_clmovement_enable = {0, "sv_clmovement_enable", "1", "whether to allow clients to use cl_movement prediction, which can cause choppy movement on the server which may annoy other players"};
 cvar_t sv_clmovement_minping = {0, "sv_clmovement_minping", "0", "if client ping is below this time in milliseconds, then their ability to use cl_movement prediction is disabled for a while (as they don't need it)"};
@@ -104,6 +104,7 @@ cvar_t sv_gameplayfix_setmodelrealbox = {0, "sv_gameplayfix_setmodelrealbox", "1
 cvar_t sv_gameplayfix_slidemoveprojectiles = {0, "sv_gameplayfix_slidemoveprojectiles", "1", "allows MOVETYPE_FLY/FLYMISSILE/TOSS/BOUNCE/BOUNCEMISSILE entities to finish their move in a frame even if they hit something, fixes 'gravity accumulation' bug for grenades on steep slopes"};
 cvar_t sv_gameplayfix_stepdown = {0, "sv_gameplayfix_stepdown", "0", "attempts to step down stairs, not just up them (prevents the familiar thud..thud..thud.. when running down stairs and slopes)"};
 cvar_t sv_gameplayfix_stepwhilejumping = {0, "sv_gameplayfix_stepwhilejumping", "1", "applies step-up onto a ledge even while airborn, useful if you would otherwise just-miss the floor when running across small areas with gaps (for instance running across the moving platforms in dm2, or jumping to the megahealth and red armor in dm2 rather than using the bridge)"};
+cvar_t sv_gameplayfix_stepmultipletimes = {0, "sv_gameplayfix_stepmultipletimes", "1", "applies step-up onto a ledge more than once in a single frame, when running quickly up stairs"};
 cvar_t sv_gameplayfix_swiminbmodels = {0, "sv_gameplayfix_swiminbmodels", "1", "causes pointcontents (used to determine if you are in a liquid) to check bmodel entities as well as the world model, so you can swim around in (possibly moving) water bmodel entities"};
 cvar_t sv_gameplayfix_upwardvelocityclearsongroundflag = {0, "sv_gameplayfix_upwardvelocityclearsongroundflag", "1", "prevents monsters, items, and most other objects from being stuck to the floor when pushed around by damage, and other situations in mods"};
 cvar_t sv_gameplayfix_downtracesupportsongroundflag = {0, "sv_gameplayfix_downtracesupportsongroundflag", "1", "prevents very short moves from clearing onground (which may make the player stick to the floor at high netfps)"};
@@ -115,7 +116,6 @@ cvar_t sv_maxairspeed = {0, "sv_maxairspeed", "30", "maximum speed a player can
 cvar_t sv_maxrate = {CVAR_SAVE | CVAR_NOTIFY, "sv_maxrate", "1000000", "upper limit on client rate cvar, should reflect your network connection quality"};
 cvar_t sv_maxspeed = {CVAR_NOTIFY, "sv_maxspeed", "320", "maximum speed a player can accelerate to when on ground (can be exceeded by tricks)"};
 cvar_t sv_maxvelocity = {CVAR_NOTIFY, "sv_maxvelocity","2000", "universal speed limit on all entities"};
-cvar_t sv_newflymove = {CVAR_NOTIFY, "sv_newflymove", "0", "enables simpler/buggier player physics (not recommended)"};
 cvar_t sv_nostep = {CVAR_NOTIFY, "sv_nostep","0", "prevents MOVETYPE_STEP entities (monsters) from moving"};
 cvar_t sv_playerphysicsqc = {CVAR_NOTIFY, "sv_playerphysicsqc", "1", "enables QuakeC function to override player physics"};
 cvar_t sv_progs = {0, "sv_progs", "progs.dat", "selects which quakec progs.dat file to run" };
@@ -416,6 +416,7 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_gameplayfix_slidemoveprojectiles);
        Cvar_RegisterVariable (&sv_gameplayfix_stepdown);
        Cvar_RegisterVariable (&sv_gameplayfix_stepwhilejumping);
+       Cvar_RegisterVariable (&sv_gameplayfix_stepmultipletimes);
        Cvar_RegisterVariable (&sv_gameplayfix_swiminbmodels);
        Cvar_RegisterVariable (&sv_gameplayfix_upwardvelocityclearsongroundflag);
        Cvar_RegisterVariable (&sv_gameplayfix_downtracesupportsongroundflag);
@@ -427,7 +428,6 @@ void SV_Init (void)
        Cvar_RegisterVariable (&sv_maxrate);
        Cvar_RegisterVariable (&sv_maxspeed);
        Cvar_RegisterVariable (&sv_maxvelocity);
-       Cvar_RegisterVariable (&sv_newflymove);
        Cvar_RegisterVariable (&sv_nostep);
        Cvar_RegisterVariable (&sv_playerphysicsqc);
        Cvar_RegisterVariable (&sv_progs);
@@ -507,8 +507,8 @@ void SV_Init (void)
                Cvar_SetValueQuick (&sv_gameplayfix_blowupfallenzombies, 0);
                // hipnotic mission pack has issues with bobbing water entities 'jittering' between different heights on alternate frames at the default 0.0138889 ticrate, 0.02 avoids this issue
                Cvar_SetValueQuick (&sys_ticrate, 0.02);
-               // hipnotic mission pack has issues in their proximity mine sticking code, which causes them to bounce off.                                                                                     
-               Cvar_SetValueQuick (&sv_gameplayfix_slidemoveprojectiles, 0);                                                                                                                                   
+               // hipnotic mission pack has issues in their proximity mine sticking code, which causes them to bounce off.
+               Cvar_SetValueQuick (&sv_gameplayfix_slidemoveprojectiles, 0);
        }
        if (gamemode == GAME_ROGUE)
        {
@@ -1645,19 +1645,24 @@ void SV_WriteEntitiesToClient(client_t *client, prvm_edict_t *clent, sizebuf_t *
        numcsqcsendstates = 0;
        for (i = 0;i < sv.numsendentities;i++)
        {
-               if (sv.sententities[sv.sendentities[i].number] == sv.sententitiesmark)
+               s = &sv.sendentities[i];
+               if (sv.sententities[s->number] == sv.sententitiesmark)
                {
-                       if(sv.sendentities[i].active == ACTIVE_NETWORK)
+                       if(s->active == ACTIVE_NETWORK)
                        {
-                               s = &sv.writeentitiestoclient_sendstates[numsendstates++];
-                               *s = sv.sendentities[i];
-                               if (s->exteriormodelforclient && s->exteriormodelforclient == sv.writeentitiestoclient_cliententitynumber)
-                                       s->flags |= RENDER_EXTERIORMODEL;
+                               if (s->exteriormodelforclient)
+                               {
+                                       if (s->exteriormodelforclient == sv.writeentitiestoclient_cliententitynumber)
+                                               s->flags |= RENDER_EXTERIORMODEL;
+                                       else
+                                               s->flags &= ~RENDER_EXTERIORMODEL;
+                               }
+                               sv.writeentitiestoclient_sendstates[numsendstates++] = s;
                        }
                        else if(sv.sendentities[i].active == ACTIVE_SHARED)
-                               sv.writeentitiestoclient_csqcsendstates[numcsqcsendstates++] = sv.sendentities[i].number;
+                               sv.writeentitiestoclient_csqcsendstates[numcsqcsendstates++] = s->number;
                        else
-                               Con_Printf("entity %d is in sv.sendentities and marked, but not active, please breakpoint me\n", sv.sendentities[i].number);
+                               Con_Printf("entity %d is in sv.sendentities and marked, but not active, please breakpoint me\n", s->number);
                }
        }
 
@@ -2700,7 +2705,9 @@ int SV_ParticleEffectIndex(const char *name)
        int filepass;
        fs_offset_t filesize;
        unsigned char *filedata;
-       const char *text, *textstart, *textend;
+       const char *text;
+       const char *textstart;
+       //const char *textend;
        char argv[16][1024];
        char filename[MAX_QPATH];
        if (!sv.particleeffectnamesloaded)
@@ -2721,7 +2728,7 @@ int SV_ParticleEffectIndex(const char *name)
                        if (!filedata)
                                continue;
                        textstart = (const char *)filedata;
-                       textend = (const char *)filedata + filesize;
+                       //textend = (const char *)filedata + filesize;
                        text = textstart;
                        for (linenumber = 1;;linenumber++)
                        {