From 05926ceec8a87671696cc5cc617bb9d5bcec5d29 Mon Sep 17 00:00:00 2001 From: spherallic Date: Wed, 20 Sep 2023 15:42:19 +0200 Subject: [PATCH] Group NiGHTS star/chip hitboxes with rings --- src/r_bbox.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/src/r_bbox.c b/src/r_bbox.c index cf417ec37..5b2a817f1 100644 --- a/src/r_bbox.c +++ b/src/r_bbox.c @@ -267,18 +267,17 @@ static boolean is_tangible (mobj_t *thing) boolean R_ThingBoundingBoxVisible(mobj_t *thing) { INT32 cvmode = cv_renderhitbox.value; + boolean ring = false; if (multiplayer) // No hitboxes in multiplayer to avoid cheating return false; - // Do not render bbox for these switch (thing->type) { default: - // First person / awayviewmobj -- rendering - // a bbox too close to the viewpoint causes - // anomalies and these are exactly on the - // viewpoint! + // First person / awayviewmobj -- rendering a bbox + // too close to the viewpoint causes anomalies + // and these are exactly on the viewpoint! if (thing != r_viewmobj) { break; @@ -290,6 +289,16 @@ boolean R_ThingBoundingBoxVisible(mobj_t *thing) // are rendered using portals in Software, // r_viewmobj does not point here. return false; + + case MT_RING: + case MT_BLUESPHERE: + case MT_NIGHTSSTAR: + case MT_NIGHTSCHIP: + // Rings and similar objects are often placed + // in large amounts, so they are handled + // separately from other tangible objects. + ring = true; + break; } switch (cvmode) @@ -304,16 +313,10 @@ boolean R_ThingBoundingBoxVisible(mobj_t *thing) return !is_tangible(thing); case RENDERHITBOX_TANGIBLE: - // Exclude rings from here, lots of them! - if (thing->type == MT_RING) - { - return false; - } - - return is_tangible(thing); + return !ring && is_tangible(thing); case RENDERHITBOX_RINGS: - return (thing->type == MT_RING || thing->type == MT_BLUESPHERE); + return ring; default: return false;