]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make one line of code human readable :)
authorterencehill <piuntn@gmail.com>
Tue, 16 Mar 2021 19:17:45 +0000 (20:17 +0100)
committerterencehill <piuntn@gmail.com>
Tue, 16 Mar 2021 19:17:45 +0000 (20:17 +0100)
qcsrc/common/replicate.qh
qcsrc/server/client.qc

index 06ed9baf6b18fe00b728bdbf5e3d20f7374d5bce..f9cb040fa8a2542141db235d56ffbec5b4d31caa 100644 (file)
@@ -8,7 +8,7 @@
        bool cvar_cl_allow_uidranking;
        float cvar_cl_autoscreenshot;
        float cvar_cl_autotaunt;
-       float cvar_cl_clippedspectating;
+       bool cvar_cl_clippedspectating;
        int cvar_cl_gunalign;
        float cvar_cl_handicap;
        float cvar_cl_jetpack_jump;
@@ -28,7 +28,7 @@
 #elif defined(SVQC)
        .float cvar_cl_handicap;
        .int cvar_cl_gunalign;
-       .float cvar_cl_clippedspectating;
+       .bool cvar_cl_clippedspectating;
        .float cvar_cl_autoscreenshot;
        .float cvar_cl_jetpack_jump;
        .float cvar_cl_movement_track_canjump;
index 1c9b3060ddbaeaebfa9254233b80a2cbb5b1c5e6..bdfc3c1fdfd80a8e018d2a597f7e9ef5a0a8152e 100644 (file)
@@ -2372,7 +2372,10 @@ void ObserverOrSpectatorThink(entity this)
                        }
                }
                else {
-                       int preferred_movetype = ((!PHYS_INPUT_BUTTON_USE(this) ? CS_CVAR(this).cvar_cl_clippedspectating : !CS_CVAR(this).cvar_cl_clippedspectating) ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
+                       bool wouldclip = CS_CVAR(this).cvar_cl_clippedspectating;
+                       if (PHYS_INPUT_BUTTON_USE(this))
+                               wouldclip = !wouldclip;
+                       int preferred_movetype = (wouldclip ? MOVETYPE_FLY_WORLDONLY : MOVETYPE_NOCLIP);
                        set_movetype(this, preferred_movetype);
                }
        } else { // jump pressed