From: Rudolf Polzer Date: Sun, 14 Aug 2011 16:15:16 +0000 (+0200) Subject: add a weird hack to work around an engine bug that doesn't let us get zoom button... X-Git-Tag: xonotic-v0.5.0~109^2~7^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=5eefde1548c4dfd4e8fa20145b9285cdfb970b2a;p=xonotic%2Fxonotic-data.pk3dir.git add a weird hack to work around an engine bug that doesn't let us get zoom button state --- diff --git a/qcsrc/client/View.qc b/qcsrc/client/View.qc index 391e53167..97ed6df28 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -384,6 +384,13 @@ void CSQC_UpdateView(float w, float h) button_attack2 = (input_buttons & BUTTON_3); button_zoom = (input_buttons & BUTTON_4); + // FIXME do we need this hack? + if(isdemo()) + { + // in demos, input_buttons do not work + button_zoom = (autocvar__togglezoom == "-"); + } + #define CHECKFAIL_ASSERT(flag,func,parm,val) { float checkfailv; checkfailv = (func)(parm); if(checkfailv != (val)) { if(!checkfail[(flag)]) localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv)); checkfail[(flag)] = 1; } } ENDS_WITH_CURLY_BRACE CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0); CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0); diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 0dc5b1849..f78691ef1 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -349,3 +349,4 @@ var float autocvar_cl_eventchase_death = 1; var float autocvar_cl_eventchase_distance = 140; var float autocvar_cl_eventchase_speed = 1.3; float autocvar_cl_lerpexcess; +string autocvar__togglezoom;