From bd9e3188633ada9ec5e641e710e9a1ab265da122 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 14 Dec 2008 19:12:41 +0000 Subject: [PATCH] - Added a SECF_NORESPAWN flag for sectors that prevents players from being respawned in such a sector. As a workaround for current map formats a new actor (DoomEdNum 9041) was added that can set the extended sector flags without the use of ACS and sector tags. The new flag can also be set with Sector_ChangeFlags. - Fixed: Players ignored MF2_TELESTOMP and always telefragged what was in the way. - Fixed: Actors with MF5_NOINTERACTION were not affected by the time freezer. SVN r1315 (trunk) --- docs/rh-log.txt | 8 ++++++++ specs/udmf_zdoom.txt | 13 ++++++++++--- src/g_shared/a_skies.cpp | 16 ++++++++++++++++ src/namedef.h | 1 + src/p_map.cpp | 2 +- src/p_mobj.cpp | 17 ++++++++++++++++- src/p_udmf.cpp | 4 ++++ src/r_defs.h | 1 + wadsrc/static/actors/shared/sharedmisc.txt | 8 ++++++++ 9 files changed, 65 insertions(+), 5 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index c284a6955..563737a0c 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,11 @@ +December 12, 2008 (Changes by Graf Zahl) +- Added a SECF_NORESPAWN flag for sectors that prevents players from being respawned + in such a sector. As a workaround for current map formats a new actor + (DoomEdNum 9041) was added that can set the extended sector flags without the + use of ACS and sector tags. The new flag can also be set with Sector_ChangeFlags. +- Fixed: Players ignored MF2_TELESTOMP and always telefragged what was in the way. +- Fixed: Actors with MF5_NOINTERACTION were not affected by the time freezer. + December 7, 2008 (Changes by Graf Zahl) - Added a strbin1 function that does the same as strbin but creates a copy instead of overwriting the original string. ACS performing this operation diff --git a/specs/udmf_zdoom.txt b/specs/udmf_zdoom.txt index 3a804bd40..26693f72e 100644 --- a/specs/udmf_zdoom.txt +++ b/specs/udmf_zdoom.txt @@ -134,8 +134,8 @@ Note: All fields default to false unless mentioned otherwise. yscaleceiling = ; // Y texture scale of ceiling texture, Default = 1.0. rotationfloor = ; // Rotation of floor texture in degrees, Default = 0.0. rotationceiling = ; // Rotation of ceiling texture in degrees, Default = 0.0. - lightfloor = ; // The floor's light level. Default is 0. - lightceiling = ; // The ceiling's light level. Default is 0. + lightfloor = ; // The floor's light level. Default is 0. + lightceiling = ; // The ceiling's light level. Default is 0. lightfloorabsolute = ; // true = 'lightfloor' is an absolute value. Default is // relative to the owning sector's light level. lightceilingabsolute = ; // true = 'lightceiling' is an absolute value. Default is @@ -146,7 +146,8 @@ Note: All fields default to false unless mentioned otherwise. desaturation = ; // Color desaturation factor. 0 = none, 1 = full, default = 0. silent = ; // Actors in this sector make no sound, nofallingdamage = ; // Falling damage is disabled in this sector - dropactors = ; // Actors drop with instantly moving floors + dropactors = ; // Actors drop with instantly moving floors (*) + norespawn = ; // Players can not respawn in this sector * Note about dropactors @@ -218,6 +219,12 @@ Added 'nofakecontrast' option to sidedefs. 1.2 21.08.2008 Added smooth lighting option to linedefs +1.3 12.12.2008 +Added NoRespawn sector flag +Fixed lightfloor and lightceiling properties for sectors. They are of type +integer, not float + + =============================================================================== EOF =============================================================================== diff --git a/src/g_shared/a_skies.cpp b/src/g_shared/a_skies.cpp index c842ab203..77704dd50 100644 --- a/src/g_shared/a_skies.cpp +++ b/src/g_shared/a_skies.cpp @@ -228,3 +228,19 @@ void ASectorSilencer::Destroy () Sector->Flags &= ~SECF_SILENT; Super::Destroy (); } + +class ASectorFlagSetter : public AActor +{ + DECLARE_CLASS (ASectorFlagSetter, AActor) +public: + void BeginPlay (); +}; + +IMPLEMENT_CLASS (ASectorFlagSetter) + +void ASectorFlagSetter::BeginPlay () +{ + Super::BeginPlay (); + Sector->Flags |= args[0]; +} + diff --git a/src/namedef.h b/src/namedef.h index 1d9c8750f..bbdefc82d 100644 --- a/src/namedef.h +++ b/src/namedef.h @@ -397,6 +397,7 @@ xx(Desaturation) xx(Silent) xx(Nofallingdamage) xx(Dropactors) +xx(NoRespawn) xx(offsetx_top) xx(offsety_top) diff --git a/src/p_map.cpp b/src/p_map.cpp index 00eb8e446..457661604 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -245,7 +245,7 @@ bool P_TeleportMove (AActor *thing, fixed_t x, fixed_t y, fixed_t z, bool telefr spechit.Clear (); - bool StompAlwaysFrags = thing->player || (thing->flags2 & MF2_TELESTOMP) || + bool StompAlwaysFrags = (thing->flags2 & MF2_TELESTOMP) || (level.flags & LEVEL_MONSTERSTELEFRAG) || telefrag; FBoundingBox box(x, y, thing->radius); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index dfdde521f..00ee3b0ed 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -2484,7 +2484,20 @@ void AActor::Tick () if (flags5 & MF5_NOINTERACTION) { - // only do the minimally necessary things here to save time. + // only do the minimally necessary things here to save time: + // Check the time freezer + // apply momentum + // ensure that the actor is not linked into the blockmap + + if (!(flags5 & MF5_NOTIMEFREEZE)) + { + //Added by MC: Freeze mode. + if (bglobal.freeze || level.flags & LEVEL_FROZEN) + { + return; + } + } + UnlinkFromWorld (); flags |= MF_NOBLOCKMAP; x += momx; @@ -2524,6 +2537,7 @@ void AActor::Tick () } } + if (cl_rockettrails & 2) { if (effects & FX_ROCKET) @@ -3464,6 +3478,7 @@ APlayerPawn *P_SpawnPlayer (FMapThing *mthing, bool tempplayer) ( deathmatch == false ) && ( gameaction != ga_worlddone ) && ( p->mo != NULL ) && + ( !(p->mo->Sector->Flags & SECF_NORESPAWN) ) && ( (p->mo->Sector->special & 255) != Damage_InstantDeath )) { spawn_x = p->mo->x; diff --git a/src/p_udmf.cpp b/src/p_udmf.cpp index da34393b6..b3521e14c 100644 --- a/src/p_udmf.cpp +++ b/src/p_udmf.cpp @@ -924,6 +924,10 @@ struct UDMFParser Flag(sec->Flags, SECF_SILENT, key); break; + case NAME_NoRespawn: + Flag(sec->Flags, SECF_NORESPAWN, key); + break; + case NAME_Nofallingdamage: Flag(sec->Flags, SECF_NOFALLINGDAMAGE, key); break; diff --git a/src/r_defs.h b/src/r_defs.h index 9f23ce2ec..2b9528e4a 100644 --- a/src/r_defs.h +++ b/src/r_defs.h @@ -253,6 +253,7 @@ enum SECF_SILENT = 1, // actors in sector make no noise SECF_NOFALLINGDAMAGE= 2, // No falling damage in this sector SECF_FLOORDROP = 4, // all actors standing on this floor will remain on it when it lowers very fast. + SECF_NORESPAWN = 8, // players can not respawn in this sector }; enum diff --git a/wadsrc/static/actors/shared/sharedmisc.txt b/wadsrc/static/actors/shared/sharedmisc.txt index a42924623..da0ff3edb 100644 --- a/wadsrc/static/actors/shared/sharedmisc.txt +++ b/wadsrc/static/actors/shared/sharedmisc.txt @@ -146,4 +146,12 @@ ACTOR FastProjectile native Projectile } +// Sector flag setter ----------------------------------------------------------- +ACTOR SectorFlagSetter 9041 native +{ + +NOBLOCKMAP + +NOGRAVITY + +DONTSPLASH + RenderStyle None +}