From: terencehill Date: Tue, 16 Mar 2021 19:17:45 +0000 (+0100) Subject: Make one line of code human readable :) X-Git-Tag: xonotic-v0.8.5~502 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9ff9346ee6ebd61d016247fbe9b51e8aefbd554d;p=xonotic%2Fxonotic-data.pk3dir.git Make one line of code human readable :) --- diff --git a/qcsrc/common/replicate.qh b/qcsrc/common/replicate.qh index 06ed9baf6..f9cb040fa 100644 --- a/qcsrc/common/replicate.qh +++ b/qcsrc/common/replicate.qh @@ -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; diff --git a/qcsrc/server/client.qc b/qcsrc/server/client.qc index 1c9b3060d..bdfc3c1fd 100644 --- a/qcsrc/server/client.qc +++ b/qcsrc/server/client.qc @@ -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