From f2c250d35df2db2ca7a69aead7fc97588d1d83a5 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 20:09:21 +0200 Subject: [PATCH 1/3] - flags7 variable added to AActor. --- src/actor.h | 1 + src/m_cheat.cpp | 1 + src/p_enemy.cpp | 1 + src/p_mobj.cpp | 11 +++++++++-- src/p_things.cpp | 1 + src/thingdef/thingdef_properties.cpp | 3 ++- src/version.h | 2 +- 7 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/actor.h b/src/actor.h index 768008182..d06e968f7 100644 --- a/src/actor.h +++ b/src/actor.h @@ -837,6 +837,7 @@ public: DWORD flags4; // [RH] Even more flags! DWORD flags5; // OMG! We need another one. DWORD flags6; // Shit! Where did all the flags go? + DWORD flags7; // // [BB] If 0, everybody can see the actor, if > 0, only members of team (VisibleToTeam-1) can see it. DWORD VisibleToTeam; diff --git a/src/m_cheat.cpp b/src/m_cheat.cpp index 07c467bac..5d9d48bea 100644 --- a/src/m_cheat.cpp +++ b/src/m_cheat.cpp @@ -311,6 +311,7 @@ void cht_DoCheat (player_t *player, int cheat) player->mo->flags4 = player->mo->GetDefault()->flags4; player->mo->flags5 = player->mo->GetDefault()->flags5; player->mo->flags6 = player->mo->GetDefault()->flags6; + player->mo->flags7 = player->mo->GetDefault()->flags7; player->mo->renderflags &= ~RF_INVISIBLE; player->mo->height = player->mo->GetDefault()->height; player->mo->radius = player->mo->GetDefault()->radius; diff --git a/src/p_enemy.cpp b/src/p_enemy.cpp index 81a58ac15..5df2b4b5e 100644 --- a/src/p_enemy.cpp +++ b/src/p_enemy.cpp @@ -2644,6 +2644,7 @@ static bool P_CheckForResurrection(AActor *self, bool usevilestates) corpsehit->flags4 = info->flags4; corpsehit->flags5 = info->flags5; corpsehit->flags6 = info->flags6; + corpsehit->flags7 = info->flags7; corpsehit->health = info->health; corpsehit->target = NULL; corpsehit->lastenemy = NULL; diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 14607a682..34100c935 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -200,8 +200,12 @@ void AActor::Serialize (FArchive &arc) << flags3 << flags4 << flags5 - << flags6 - << special1 + << flags6; + if (SaveVersion >= 4504) + { + arc << flags7; + } + arc << special1 << special2 << health << movedir @@ -6133,6 +6137,9 @@ void PrintMiscActorInfo(AActor *query) Printf("\n\tflags6: %x", query->flags6); for (flagi = 0; flagi <= 31; flagi++) if (query->flags6 & 1<flags7); + for (flagi = 0; flagi <= 31; flagi++) + if (query->flags7 & 1<BounceFlags, FIXED2FLOAT(query->bouncefactor), FIXED2FLOAT(query->wallbouncefactor)); diff --git a/src/p_things.cpp b/src/p_things.cpp index a0f905a7f..4828e8cbc 100644 --- a/src/p_things.cpp +++ b/src/p_things.cpp @@ -452,6 +452,7 @@ bool P_Thing_Raise(AActor *thing) thing->flags4 = info->flags4; thing->flags5 = info->flags5; thing->flags6 = info->flags6; + thing->flags7 = info->flags7; thing->health = info->health; thing->target = NULL; thing->lastenemy = NULL; diff --git a/src/thingdef/thingdef_properties.cpp b/src/thingdef/thingdef_properties.cpp index dc08db361..262846bf2 100644 --- a/src/thingdef/thingdef_properties.cpp +++ b/src/thingdef/thingdef_properties.cpp @@ -1286,7 +1286,8 @@ DEFINE_PROPERTY(clearflags, 0, Actor) defaults->flags3 = defaults->flags4 = defaults->flags5 = - defaults->flags6 = 0; + defaults->flags6 = + defaults->flags7 = 0; defaults->flags2 &= MF2_ARGSDEFINED; // this flag must not be cleared } diff --git a/src/version.h b/src/version.h index 01fbc7a88..0c62c5ef2 100644 --- a/src/version.h +++ b/src/version.h @@ -76,7 +76,7 @@ const char *GetVersionString(); // Use 4500 as the base git save version, since it's higher than the // SVN revision ever got. -#define SAVEVER 4503 +#define SAVEVER 4504 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) From 44a1b94ad9bd67496b0cbfe508c603ecb4f13df1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 20:23:54 +0200 Subject: [PATCH 2/3] - added MF6_NOTELESTOMP flag that prevents an actor from telefragging under all possible circumstances. --- src/actor.h | 7 ++++--- src/p_map.cpp | 3 +-- src/thingdef/thingdef_data.cpp | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/actor.h b/src/actor.h index d06e968f7..98210753a 100644 --- a/src/actor.h +++ b/src/actor.h @@ -236,7 +236,7 @@ enum MF4_RANDOMIZE = 0x00000010, // Missile has random initial tic count MF4_NOSKIN = 0x00000020, // Player cannot use skins MF4_FIXMAPTHINGPOS = 0x00000040, // Fix this actor's position when spawned as a map thing - MF4_ACTLIKEBRIDGE = 0x00000080, // Pickups can "stand" on this actor + MF4_ACTLIKEBRIDGE = 0x00000080, // Pickups can "stand" on this actor / cannot be moved by any sector action. MF4_STRIFEDAMAGE = 0x00000100, // Strife projectiles only do up to 4x damage, not 8x MF4_CANUSEWALLS = 0x00000200, // Can activate 'use' specials @@ -266,7 +266,7 @@ enum // --- mobj.flags5 --- MF5_DONTDRAIN = 0x00000001, // cannot be drained health from. - /* = 0x00000002, */ + /* = 0x00000002, reserved for use by scripting branch */ MF5_NODROPOFF = 0x00000004, // cannot drop off under any circumstances. MF5_NOFORWARDFALL = 0x00000008, // Does not make any actor fall forward by being damaged by this MF5_COUNTSECRET = 0x00000010, // From Doom 64: actor acts like a secret @@ -284,7 +284,7 @@ enum MF5_NEVERFAST = 0x00010000, // never uses 'fast' attacking logic MF5_ALWAYSRESPAWN = 0x00020000, // always respawns, regardless of skill setting MF5_NEVERRESPAWN = 0x00040000, // never respawns, regardless of skill setting - MF5_DONTRIP = 0x00080000, // Ripping projectiles explode when hittin this actor + MF5_DONTRIP = 0x00080000, // Ripping projectiles explode when hitting this actor MF5_NOINFIGHTING = 0x00100000, // This actor doesn't switch target when it's hurt MF5_NOINTERACTION = 0x00200000, // Thing is completely excluded from any gameplay related checks MF5_NOTIMEFREEZE = 0x00400000, // Actor is not affected by time freezer @@ -332,6 +332,7 @@ enum MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup. + MF6_NOTELESTOMP = 0x80000000, // cannot telefrag under any circumstances (even when set by MAPINFO) // --- mobj.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index da87481d0..a892c4a95 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -334,8 +334,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr spechit.Clear (); - bool StompAlwaysFrags = (thing->flags2 & MF2_TELESTOMP) || - (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag; + bool StompAlwaysFrags = ((thing->flags2 & MF2_TELESTOMP) || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag) && !(thing->flags6 & MF6_NOTELESTOMP); FBoundingBox box(x, y, thing->radius); FBlockLinesIterator it(box); diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index ef0cf2fe1..938c48e45 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -235,6 +235,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6), + DEFINE_FLAG(MF6, NOTELESTOMP, AActor, flags6), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), From e14590d8ced826c6301e31e9908927a4657d5293 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 12 Aug 2013 20:41:33 +0200 Subject: [PATCH 3/3] - moved NOTELESTOMP to flags7. When committing I was accidentally on maint instead of master and in master flags6 was already full. --- src/actor.h | 6 +++++- src/p_interaction.cpp | 3 +++ src/p_map.cpp | 2 +- src/p_mobj.cpp | 2 +- src/thingdef/thingdef_data.cpp | 4 +++- 5 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/actor.h b/src/actor.h index 98210753a..5a3298488 100644 --- a/src/actor.h +++ b/src/actor.h @@ -332,7 +332,11 @@ enum MF6_INTRYMOVE = 0x10000000, // Executing P_TryMove MF6_NOTAUTOAIMED = 0x20000000, // Do not subject actor to player autoaim. MF6_NOTONAUTOMAP = 0x40000000, // will not be shown on automap with the 'scanner' powerup. - MF6_NOTELESTOMP = 0x80000000, // cannot telefrag under any circumstances (even when set by MAPINFO) + +// --- mobj.flags6 --- + + MF7_NEVERTARGET = 0x00000001, // can not be targetted at all, even if monster friendliness is considered. + MF7_NOTELESTOMP = 0x00000002, // cannot telefrag under any circumstances (even when set by MAPINFO) // --- mobj.renderflags --- diff --git a/src/p_interaction.cpp b/src/p_interaction.cpp index 0ee955a82..47ed87888 100644 --- a/src/p_interaction.cpp +++ b/src/p_interaction.cpp @@ -1508,6 +1508,9 @@ bool AActor::OkayToSwitchTarget (AActor *other) if (other == this) return false; // [RH] Don't hate self (can happen when shooting barrels) + if (other->flags7 & MF7_NEVERTARGET) + return false; // never EVER target me! + if (!(other->flags & MF_SHOOTABLE)) return false; // Don't attack things that can't be hurt diff --git a/src/p_map.cpp b/src/p_map.cpp index a892c4a95..3c7370f02 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -334,7 +334,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr spechit.Clear (); - bool StompAlwaysFrags = ((thing->flags2 & MF2_TELESTOMP) || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag) && !(thing->flags6 & MF6_NOTELESTOMP); + bool StompAlwaysFrags = ((thing->flags2 & MF2_TELESTOMP) || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag) && !(thing->flags7 & MF7_NOTELESTOMP); FBoundingBox box(x, y, thing->radius); FBlockLinesIterator it(box); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 34100c935..a2addad0e 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -830,7 +830,7 @@ void AActor::CopyFriendliness (AActor *other, bool changeTarget, bool resetHealt flags4 = (flags4 & ~(MF4_NOHATEPLAYERS | MF4_BOSSSPAWNED)) | (other->flags4 & (MF4_NOHATEPLAYERS | MF4_BOSSSPAWNED)); FriendPlayer = other->FriendPlayer; DesignatedTeam = other->DesignatedTeam; - if (changeTarget && other->target != NULL && !(other->target->flags3 & MF3_NOTARGET)) + if (changeTarget && other->target != NULL && !(other->target->flags3 & MF3_NOTARGET) && !(other->target->flags7 & MF7_NEVERTARGET)) { // LastHeard must be set as well so that A_Look can react to the new target if called LastHeard = target = other->target; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 938c48e45..e4c166761 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -235,7 +235,9 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF6, POISONALWAYS, AActor, flags6), DEFINE_FLAG(MF6, NOTAUTOAIMED, AActor, flags6), DEFINE_FLAG(MF6, NOTONAUTOMAP, AActor, flags6), - DEFINE_FLAG(MF6, NOTELESTOMP, AActor, flags6), + + DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7), + DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),