From 191103fec159e679b818b827c43d9ecc7f34ef19 Mon Sep 17 00:00:00 2001 From: SinnamonLat Date: Sat, 22 Jan 2022 11:41:49 +0100 Subject: [PATCH] Fix a dumb mistake, add DMG_WOMBO to orbinauts, jawz and banana hits --- src/k_collide.c | 4 ++-- src/p_inter.c | 13 ++++++------- src/p_local.h | 2 +- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/src/k_collide.c b/src/k_collide.c index 9b0463bfc..92b6c6e47 100644 --- a/src/k_collide.c +++ b/src/k_collide.c @@ -48,7 +48,7 @@ boolean K_OrbinautJawzCollide(mobj_t *t1, mobj_t *t2) else { // Player Damage - P_DamageMobj(t2, t1, t1->target, 1, DMG_WIPEOUT); + P_DamageMobj(t2, t1, t1->target, 1, DMG_WIPEOUT|DMG_WOMBO); K_KartBouncing(t2, t1); S_StartSound(t2, sfx_s3k7b); } @@ -143,7 +143,7 @@ boolean K_BananaBallhogCollide(mobj_t *t1, mobj_t *t2) } else { - P_DamageMobj(t2, t1, t1->target, 1, DMG_NORMAL); + P_DamageMobj(t2, t1, t1->target, 1, DMG_NORMAL|DMG_WOMBO); } damageitem = true; diff --git a/src/p_inter.c b/src/p_inter.c index 55d33c360..0b46bb3ad 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -1930,18 +1930,17 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da if (combo == false) { // Check if we should allow wombo combos (DMG_WOMBO) - boolean allowcombo; + boolean allowcombo = false; // For MISSILE OBJECTS, allow combo BY DEFAULT. If DMG_WOMBO is set, do *NOT* allow it. - if (inflictor && !P_MobjWasRemoved(inflictor) && (inflictor->flags & MF_MISSILE)) - allowcombo = !(damagetype & DMG_WOMBO); + if (inflictor && !P_MobjWasRemoved(inflictor) && (inflictor->flags & MF_MISSILE) && !(damagetype & DMG_WOMBO)) + allowcombo = true; // OTHERWISE, only allow combos IF DMG_WOMBO *IS* set. - else - allowcombo = (damagetype & DMG_WOMBO); + else if (damagetype & DMG_WOMBO) + allowcombo = true; - - if ((player->mo->hitlag == 0 || !allowcombo) && player->flashing > 0) + if ((player->mo->hitlag == 0 || allowcombo == false) && player->flashing > 0) { // Post-hit invincibility K_DoInstashield(player); diff --git a/src/p_local.h b/src/p_local.h index 1dd631ecb..a3d5ecd74 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -486,9 +486,9 @@ typedef struct BasicFF_s #define DMG_SPECTATOR 0x83 #define DMG_TIMEOVER 0x84 // Masks +#define DMG_WOMBO 0x10 // Flag - setting this flag allows objects to damage you if you're already in spinout. The effect is reversed on objects with MF_MISSILE (setting it prevents them from comboing in spinout) #define DMG_STEAL 0x20 // Flag - can steal bumpers, will only deal damage to players, and will not deal damage outside Battle Mode. #define DMG_CANTHURTSELF 0x40 // Flag - cannot hurt your self or your team -#define DMG_WOMBO 0x80 // Flag - setting this flag allows objects to damage you if you're already in spinout. The effect is reversed on objects with MF_MISSILE (setting it prevents them from comboing in spinout) #define DMG_DEATHMASK DMG_INSTAKILL // if bit 7 is set, this is a death type instead of a damage type #define DMG_TYPEMASK 0x0F // Get type without any flags