From: Rudolf Polzer Date: Tue, 20 Dec 2011 12:59:30 +0000 (+0100) Subject: simplify X-Git-Tag: xonotic-v0.6.0~74^2~91^2 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=21836a0c615c95db00ec3993f13f91330d5d9d39;p=xonotic%2Fxonotic-data.pk3dir.git simplify --- diff --git a/qcsrc/csqcmodel/cl_player.qc b/qcsrc/csqcmodel/cl_player.qc index 70d29592b..bcb0c0831 100644 --- a/qcsrc/csqcmodel/cl_player.qc +++ b/qcsrc/csqcmodel/cl_player.qc @@ -209,28 +209,28 @@ void CSQCPlayer_SetCamera() #endif #ifdef COMPAT_XON050_ENGINE - if((view == self) && (checkextension("DP_CSQC_V_CALCREFDEF") || checkextension("DP_CSQC_V_CALCREFDEF_WIP1"))) -#else - if(view == self) + if(view && !(checkextension("DP_CSQC_V_CALCREFDEF") || checkextension("DP_CSQC_V_CALCREFDEF_WIP1"))) + { + // legacy code, not totally correct, but good enough for not having V_CalcRefdef + setproperty(VF_ORIGIN, view.origin + '0 0 1' * getstati(STAT_VIEWHEIGHT)); + setproperty(VF_ANGLES, view.angles); + } + else #endif + if(view) { var float refdefflags = 0; - if(self.csqcmodel_teleported) + if(view.csqcmodel_teleported) { refdefflags |= REFDEFFLAG_TELEPORTED; - self.csqcmodel_teleported = 0; + view.csqcmodel_teleported = 0; } if(input_buttons & 4) refdefflags |= REFDEFFLAG_JUMPING; - V_CalcRefdef(self, refdefflags); - } - else if(view) - { - setproperty(VF_ORIGIN, view.origin + view.view_ofs); - setproperty(VF_ANGLES, view.angles); + V_CalcRefdef(view, refdefflags); } else {