diff --git a/src/r_voxel.c b/src/r_voxel.c index 2e92b265..feef01bb 100644 --- a/src/r_voxel.c +++ b/src/r_voxel.c @@ -17,6 +17,7 @@ #include "doomstat.h" #include "doomtype.h" +#include "hu_crosshair.h" #include "i_printf.h" #include "i_video.h" #include "info.h" @@ -707,6 +708,18 @@ boolean VX_ProjectVoxel (mobj_t * thing) vis->brightmap = R_BrightmapForSprite(thing->sprite); vis->color = thing->bloodcolor; + // [Alaux] Lock crosshair on target + if (STRICTMODE(hud_crosshair_lockon) && thing == crosshair_target) + { + HU_UpdateCrosshairLock + ( + BETWEEN(0, viewwidth - 1, (centerxfrac + FixedMul(tx, xscale)) >> FRACBITS), + BETWEEN(0, viewheight - 1, (centeryfrac + FixedMul(viewz - gz - crosshair_target->actualheight/2, xscale)) >> FRACBITS) + ); + + crosshair_target = NULL; // Don't update it again until next tic + } + return true; }