From d91f0c4090fe332dca474902185acce0761a6700 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 24 Feb 2009 21:19:10 +0000 Subject: [PATCH] - Added GCC headers for intptr_t to tarray.h. - Added MF5_PAINLESS flag for projectiles that don't make the target go into the pain state. SVN r1446 (trunk) --- docs/rh-log.txt | 7 ++++++- src/actor.h | 1 + src/p_interaction.cpp | 3 ++- src/tarray.h | 7 +++++++ src/thingdef/thingdef_data.cpp | 1 + 5 files changed, 17 insertions(+), 2 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 9500c0edd..7cc3593e0 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,4 +1,9 @@ -February 23, 2009 +February 24, 2009 (Changes by Graf Zahl) +- Added GCC headers for intptr_t to tarray.h. +- Added MF5_PAINLESS flag for projectiles that don't make the target go into + the pain state. + +February 23, 2009 - Changed DEM_ADDSLOTDEFAULT, DEM_ADDSLOT, and DEM_SETSLOT to be more space- efficient. - Fixed: player->oldbuttons was copied from the current button set at the end diff --git a/src/actor.h b/src/actor.h index 17276366d..fd88d11f3 100644 --- a/src/actor.h +++ b/src/actor.h @@ -306,6 +306,7 @@ enum MF5_BRIGHT = 0x08000000, // Actor is always rendered fullbright MF5_CANTSEEK = 0x10000000, // seeker missiles cannot home in on this actor MF5_INCONVERSATION = 0x20000000, // Actor is having a conversation + MF5_PAINLESS = 0x40000000, // Actor always inflicts painless damage. // --- mobj.renderflags --- diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 372318e5f..9a5c7a4f3 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1193,7 +1193,8 @@ void P_DamageMobj (AActor *target, AActor *inflictor, AActor *source, int damage } } - if (!(target->flags5 & MF5_NOPAIN) && (pr_damagemobj() < painchance) && !(target->flags & MF_SKULLFLY)) + if (!(target->flags5 & MF5_NOPAIN) && (inflictor == NULL || !(inflictor->flags5 & MF5_PAINLESS)) && + (pr_damagemobj() < painchance) && !(target->flags & MF_SKULLFLY)) { if (mod == NAME_Electric) { diff --git a/src/tarray.h b/src/tarray.h index 1075f8e6a..72bbc5e61 100644 --- a/src/tarray.h +++ b/src/tarray.h @@ -38,6 +38,13 @@ #include #include #include + +#if !defined(_WIN32) +#include // for intptr_t +#elif !defined(_MSC_VER) +#include // for mingw +#endif + #include "m_alloc.h" class FArchive; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index fcba47a5b..e9b681cf7 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -207,6 +207,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF5, NOVERTICALMELEERANGE, AActor, flags5), DEFINE_FLAG(MF5, BRIGHT, AActor, flags5), DEFINE_FLAG(MF5, CANTSEEK, AActor, flags5), + DEFINE_FLAG(MF5, PAINLESS, AActor, flags5), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),