From 351881cbddc70354cd48d82a679232bbb9f93966 Mon Sep 17 00:00:00 2001 From: Fabian Greffrath Date: Tue, 21 Nov 2023 22:47:56 +0100 Subject: [PATCH] weapon pickup voxels spinning in place --- src/r_voxel.c | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/src/r_voxel.c b/src/r_voxel.c index 1c06a861..6696fd86 100644 --- a/src/r_voxel.c +++ b/src/r_voxel.c @@ -393,10 +393,28 @@ static int VX_RotateModeForThing (mobj_t * thing) break; } - // in most maps, items don't have "nice" facing directions, so this - // option orientates them in a way similar to sprites. - if (vx_rotate_items && (thing->flags & MF_SPECIAL)) - return 1; + if (vx_rotate_items) + { + switch (thing->sprite) + { + case SPR_SHOT: + case SPR_MGUN: + case SPR_LAUN: + case SPR_PLAS: + case SPR_BFUG: + case SPR_CSAW: + case SPR_SGN2: + return 3; + + default: + break; + } + + // in most maps, items don't have "nice" facing directions, so this + // option orientates them in a way similar to sprites. + if (thing->flags & MF_SPECIAL) + return 1; + } // use existing angle return 0; @@ -534,6 +552,10 @@ boolean VX_ProjectVoxel (mobj_t * thing) case 2: angle = R_PointToAngle (gx, gy) + ANG180; break; + + case 3: + angle = 4 * leveltime * ANG1; + break; } angle_t ang2 = ANG180 - viewangle + angle;