From: terencehill Date: Mon, 1 Feb 2016 19:24:34 +0000 (+0100) Subject: Fix weaponmodel effects passing through warpzones X-Git-Tag: xonotic-v0.8.2~1190^2~4 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9f5aad709;p=xonotic%2Fxonotic-data.pk3dir.git Fix weaponmodel effects passing through warpzones --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 0b2b653a7..d6d82acbe 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -275,6 +275,8 @@ void viewmodel_animate(entity this) void viewmodel_draw(entity this) { + if(!activeweapon) + return; int mask = (intermission || (STAT(HEALTH) <= 0) || autocvar_chase_active) ? 0 : MASK_NORMAL; float a = this.alpha; static bool wasinvehicle; @@ -1662,6 +1664,10 @@ void CSQC_UpdateView(float w, float h) ov_enabled = false; } + // run viewmodel_draw before updating view_angles to the angles calculated by WarpZone_FixView + // viewmodel_draw needs to use the view_angles set by the engine on every CSQC_UpdateView call + FOREACH_ENTITY(it.draw, LAMBDA(it.draw(it))); + // Render the Scene view_origin = getpropertyvec(VF_ORIGIN); view_angles = getpropertyvec(VF_ANGLES); @@ -1842,8 +1848,6 @@ void CSQC_UpdateView(float w, float h) mousepos = mousepos*0.5 + getmousepos(); */ - FOREACH_ENTITY(it.draw, LAMBDA(it.draw(it))); - addentities(MASK_NORMAL | MASK_ENGINE | MASK_ENGINEVIEWMODELS); renderscene();