From ce0b23a5769826118892ef42bb3e6387fc9ddb47 Mon Sep 17 00:00:00 2001 From: mazmazz Date: Sun, 12 Aug 2018 12:42:21 -0400 Subject: [PATCH] Set Drone hitbox radius by upmost 4 bits of Angle --- src/info.c | 2 +- src/p_mobj.c | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/info.c b/src/info.c index f1d78c85e..fc30011bf 100644 --- a/src/info.c +++ b/src/info.c @@ -16121,7 +16121,7 @@ mobjinfo_t mobjinfo[NUMMOBJTYPES] = 1000, // mass 0, // damage sfx_ideya, // activesound - MF_NOGRAVITY|MF_SPECIAL, // flags + MF_NOGRAVITY|MF_NOCLIP|MF_SPECIAL, // flags S_NULL // raisestate }, diff --git a/src/p_mobj.c b/src/p_mobj.c index fe78fa79d..5292ef15e 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -10685,16 +10685,18 @@ ML_EFFECT4 : Don't clip inside the ground boolean middlealigned = (mthing->options & MTF_EXTRA) && !(mthing->options & MTF_OBJECTSPECIAL); boolean bottomoffsetted = !(mthing->options & MTF_OBJECTSPECIAL) && !(mthing->options & MTF_EXTRA); - INT16 timelimit = mthing->angle; + INT16 timelimit = mthing->angle & 0xFFF; + fixed_t hitboxradius = (mthing->angle & 0xF000) * 32 * FRACUNIT; fixed_t hitboxheight = mthing->extrainfo * 32 * FRACUNIT; - // if you want to use parameter for something else, do this instead: - // timelimit = mthing->angle & 0xFFF; hitboxheight = (mthing->extrainfo >> 12) * 32 * FRACUNIT; fixed_t oldheight = mobj->height; fixed_t dronemanoffset, goaloffset, sparkleoffset, droneboxmandiff, dronemangoaldiff; - if (mthing->angle > 0) + if (timelimit > 0) mobj->health = timelimit; + if (hitboxradius > 0) + mobj->radius = hitboxradius; + if (hitboxheight > 0) mobj->height = hitboxheight; else