From 9a7f570b19961968d8d675596a06d4fa3fd988a4 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Sat, 10 Nov 2018 09:00:49 -0600 Subject: [PATCH] Added DMG_NO_ENHANCE for DamageMobj. - Disables PowerDamage's effect, similar to DMG_NO_PROTECT disabling PowerProtect. --- src/p_interaction.cpp | 2 +- src/p_local.h | 1 + wadsrc/static/zscript/constants.txt | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 2d7d6026c..d5404a19a 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1086,7 +1086,7 @@ static int DamageMobj (AActor *target, AActor *inflictor, AActor *source, int da damage = int(damage * source->DamageMultiply); // Handle active damage modifiers (e.g. PowerDamage) - if (damage > 0) + if (damage > 0 && !(flags & DMG_NO_ENHANCE)) { damage = source->GetModifiedDamage(mod, damage, false); } diff --git a/src/p_local.h b/src/p_local.h index 06748c76a..9231058fd 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -454,6 +454,7 @@ enum EDmgFlags DMG_USEANGLE = 512, DMG_NO_PAIN = 1024, DMG_EXPLOSION = 2048, + DMG_NO_ENHANCE = 4096, }; diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 92f548355..ccb3f4848 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -940,6 +940,7 @@ enum EDmgFlags DMG_USEANGLE = 512, DMG_NO_PAIN = 1024, DMG_EXPLOSION = 2048, + DMG_NO_ENHANCE = 4096, } enum EReplace