From ae2f7b87071d7dbcd2e0d274485411106a7a70b1 Mon Sep 17 00:00:00 2001 From: Edoardo Prezioso Date: Sat, 19 Jul 2014 00:53:18 +0200 Subject: [PATCH 1/5] - Remove a duplicate of a custom offsetof macro. It's already defined in cmdlib.h . --- src/p_terrain.cpp | 47 ++++++++++++++++++++++------------------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/src/p_terrain.cpp b/src/p_terrain.cpp index fdd98c96a..a1a9ea25b 100644 --- a/src/p_terrain.cpp +++ b/src/p_terrain.cpp @@ -189,41 +189,38 @@ static const char *TerrainKeywords[] = NULL }; -// Alternate offsetof macro to shut GCC up -#define theoffsetof(type,field) ((size_t)&((type*)1)->field - 1) - static FGenericParse SplashParser[] = { { GEN_End, {0} }, - { GEN_Sound, {theoffsetof(FSplashDef, SmallSplashSound)} }, - { GEN_Fixed, {theoffsetof(FSplashDef, SmallSplashClip)} }, - { GEN_Sound, {theoffsetof(FSplashDef, NormalSplashSound)} }, - { GEN_Class, {theoffsetof(FSplashDef, SmallSplash)} }, - { GEN_Class, {theoffsetof(FSplashDef, SplashBase)} }, - { GEN_Class, {theoffsetof(FSplashDef, SplashChunk)} }, - { GEN_Byte, {theoffsetof(FSplashDef, ChunkXVelShift)} }, - { GEN_Byte, {theoffsetof(FSplashDef, ChunkYVelShift)} }, - { GEN_Byte, {theoffsetof(FSplashDef, ChunkZVelShift)} }, - { GEN_Fixed, {theoffsetof(FSplashDef, ChunkBaseZVel)} }, - { GEN_Bool, {theoffsetof(FSplashDef, NoAlert)} } + { GEN_Sound, {myoffsetof(FSplashDef, SmallSplashSound)} }, + { GEN_Fixed, {myoffsetof(FSplashDef, SmallSplashClip)} }, + { GEN_Sound, {myoffsetof(FSplashDef, NormalSplashSound)} }, + { GEN_Class, {myoffsetof(FSplashDef, SmallSplash)} }, + { GEN_Class, {myoffsetof(FSplashDef, SplashBase)} }, + { GEN_Class, {myoffsetof(FSplashDef, SplashChunk)} }, + { GEN_Byte, {myoffsetof(FSplashDef, ChunkXVelShift)} }, + { GEN_Byte, {myoffsetof(FSplashDef, ChunkYVelShift)} }, + { GEN_Byte, {myoffsetof(FSplashDef, ChunkZVelShift)} }, + { GEN_Fixed, {myoffsetof(FSplashDef, ChunkBaseZVel)} }, + { GEN_Bool, {myoffsetof(FSplashDef, NoAlert)} } }; static FGenericParse TerrainParser[] = { { GEN_End, {0} }, - { GEN_Splash, {theoffsetof(FTerrainDef, Splash)} }, - { GEN_Int, {theoffsetof(FTerrainDef, DamageAmount)} }, + { GEN_Splash, {myoffsetof(FTerrainDef, Splash)} }, + { GEN_Int, {myoffsetof(FTerrainDef, DamageAmount)} }, { GEN_Custom, {(size_t)ParseDamage} }, - { GEN_Int, {theoffsetof(FTerrainDef, DamageTimeMask)} }, - { GEN_Fixed, {theoffsetof(FTerrainDef, FootClip)} }, - { GEN_Float, {theoffsetof(FTerrainDef, StepVolume)} }, - { GEN_Time, {theoffsetof(FTerrainDef, WalkStepTics)} }, - { GEN_Time, {theoffsetof(FTerrainDef, RunStepTics)} }, - { GEN_Sound, {theoffsetof(FTerrainDef, LeftStepSound)} }, - { GEN_Sound, {theoffsetof(FTerrainDef, RightStepSound)} }, - { GEN_Bool, {theoffsetof(FTerrainDef, IsLiquid)} }, + { GEN_Int, {myoffsetof(FTerrainDef, DamageTimeMask)} }, + { GEN_Fixed, {myoffsetof(FTerrainDef, FootClip)} }, + { GEN_Float, {myoffsetof(FTerrainDef, StepVolume)} }, + { GEN_Time, {myoffsetof(FTerrainDef, WalkStepTics)} }, + { GEN_Time, {myoffsetof(FTerrainDef, RunStepTics)} }, + { GEN_Sound, {myoffsetof(FTerrainDef, LeftStepSound)} }, + { GEN_Sound, {myoffsetof(FTerrainDef, RightStepSound)} }, + { GEN_Bool, {myoffsetof(FTerrainDef, IsLiquid)} }, { GEN_Custom, {(size_t)ParseFriction} }, - { GEN_Bool, {theoffsetof(FTerrainDef, AllowProtection)} }, + { GEN_Bool, {myoffsetof(FTerrainDef, AllowProtection)} }, }; From 0276760a2d45dc5928e8de5cd51446af17b4dfda Mon Sep 17 00:00:00 2001 From: Edward Richardson Date: Sat, 19 Jul 2014 20:49:53 +1200 Subject: [PATCH 2/5] Animate switches when bumped --- src/p_spec.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_spec.cpp b/src/p_spec.cpp index e66dc2ab4..5068cd575 100644 --- a/src/p_spec.cpp +++ b/src/p_spec.cpp @@ -252,7 +252,7 @@ bool P_ActivateLine (line_t *line, AActor *mo, int side, int activationType) if (buttonSuccess) { - if (activationType == SPAC_Use || activationType == SPAC_Impact) + if (activationType == SPAC_Use || activationType == SPAC_Impact || activationType == SPAC_Push) { P_ChangeSwitchTexture (line->sidedef[0], repeat, special); } From a21f01bc5f9b656f2a35376cf850808bac5ea792 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 26 Jul 2014 10:15:07 +0200 Subject: [PATCH 3/5] - added jpalomo's submission to make freelook a 3-state setting, like crouch and jump. This required moving around the flags a bit so demo compatibility had to be bumped. It may also require adjustment for launchers that can set the dmflags. --- src/d_main.cpp | 5 ++++- src/doomdef.h | 3 ++- src/g_game.cpp | 7 +++++++ src/g_level.cpp | 6 +++--- src/g_shared/a_pickups.cpp | 2 +- src/version.h | 8 ++++---- wadsrc/static/menudef.txt | 8 ++++---- 7 files changed, 25 insertions(+), 14 deletions(-) diff --git a/src/d_main.cpp b/src/d_main.cpp index 628a885b2..90391433a 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -422,7 +422,7 @@ CVAR (Flag, sv_fastmonsters, dmflags, DF_FAST_MONSTERS); CVAR (Flag, sv_nojump, dmflags, DF_NO_JUMP); CVAR (Flag, sv_allowjump, dmflags, DF_YES_JUMP); CVAR (Flag, sv_nofreelook, dmflags, DF_NO_FREELOOK); -CVAR (Flag, sv_respawnsuper, dmflags, DF_RESPAWN_SUPER); +CVAR (Flag, sv_allowfreelook, dmflags, DF_YES_FREELOOK); CVAR (Flag, sv_nofov, dmflags, DF_NO_FOV); CVAR (Flag, sv_noweaponspawn, dmflags, DF_NO_COOP_WEAPON_SPAWN); CVAR (Flag, sv_nocrouch, dmflags, DF_NO_CROUCH); @@ -439,6 +439,7 @@ CVAR (Flag, sv_coophalveammo, dmflags, DF_COOP_HALVE_AMMO); CVAR (Mask, sv_crouch, dmflags, DF_NO_CROUCH|DF_YES_CROUCH); CVAR (Mask, sv_jump, dmflags, DF_NO_JUMP|DF_YES_JUMP); CVAR (Mask, sv_fallingdamage, dmflags, DF_FORCE_FALLINGHX|DF_FORCE_FALLINGZD); +CVAR (Mask, sv_freelook, dmflags, DF_NO_FREELOOK|DF_YES_FREELOOK); //========================================================================== // @@ -510,6 +511,8 @@ CVAR (Flag, sv_noautoaim, dmflags2, DF2_NOAUTOAIM); CVAR (Flag, sv_dontcheckammo, dmflags2, DF2_DONTCHECKAMMO); CVAR (Flag, sv_killbossmonst, dmflags2, DF2_KILLBOSSMONST); CVAR (Flag, sv_nocountendmonst, dmflags2, DF2_NOCOUNTENDMONST); +CVAR (Flag, sv_respawnsuper, dmflags2, DF2_RESPAWN_SUPER); + //========================================================================== // // CVAR compatflags diff --git a/src/doomdef.h b/src/doomdef.h index 6ef9fcd04..3e00975cf 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -254,7 +254,7 @@ enum DF_NO_JUMP = 1 << 16, // Don't allow jumping DF_YES_JUMP = 2 << 16, DF_NO_FREELOOK = 1 << 18, // Don't allow freelook - DF_RESPAWN_SUPER = 1 << 19, // Respawn invulnerability and invisibility + DF_YES_FREELOOK = 2 << 18, DF_NO_FOV = 1 << 20, // Only let the arbitrator set FOV (for all players) DF_NO_COOP_WEAPON_SPAWN = 1 << 21, // Don't spawn multiplayer weapons in coop games DF_NO_CROUCH = 1 << 22, // Don't allow crouching @@ -298,6 +298,7 @@ enum DF2_DONTCHECKAMMO = 1 << 24, // Don't Check ammo when switching weapons. DF2_KILLBOSSMONST = 1 << 25, // Kills all monsters spawned by a boss cube when the boss dies DF2_NOCOUNTENDMONST = 1 << 26, // Do not count monsters in 'end level when dying' sectors towards kill count + DF2_RESPAWN_SUPER = 1 << 27, // Respawn invulnerability and invisibility }; // [RH] Compatibility flags. diff --git a/src/g_game.cpp b/src/g_game.cpp index b84ac890d..2058c2df0 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -1835,6 +1835,13 @@ void G_DoLoadGame () BYTE *vars_p = (BYTE *)text; C_ReadCVars (&vars_p); delete[] text; + if (SaveVersion <= 4509) + { + // account for the flag shuffling for making freelook a 3-state option + INTBOOL flag = dmflags & DF_YES_FREELOOK; + dmflags = dmflags & ~DF_YES_FREELOOK; + if (flag) dmflags2 = dmflags2 | DF2_RESPAWN_SUPER; + } } // dearchive all the modifications diff --git a/src/g_level.cpp b/src/g_level.cpp index c4aafda4b..69bee5de1 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -1320,11 +1320,11 @@ bool FLevelLocals::IsCrouchingAllowed() const bool FLevelLocals::IsFreelookAllowed() const { - if (level.flags & LEVEL_FREELOOK_NO) + if (dmflags & DF_NO_FREELOOK) return false; - if (level.flags & LEVEL_FREELOOK_YES) + if (dmflags & DF_YES_FREELOOK) return true; - return !(dmflags & DF_NO_FREELOOK); + return !(level.flags & LEVEL_FREELOOK_NO); } //========================================================================== diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index f14e7f4c7..acb6224a3 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -497,7 +497,7 @@ bool AInventory::SpecialDropAction (AActor *dropper) bool AInventory::ShouldRespawn () { - if ((ItemFlags & IF_BIGPOWERUP) && !(dmflags & DF_RESPAWN_SUPER)) return false; + if ((ItemFlags & IF_BIGPOWERUP) && !(dmflags2 & DF2_RESPAWN_SUPER)) return false; if (ItemFlags & IF_NEVERRESPAWN) return false; return !!(dmflags & DF_ITEMS_RESPAWN); } diff --git a/src/version.h b/src/version.h index 6b6361d26..6d24c3fe8 100644 --- a/src/version.h +++ b/src/version.h @@ -51,7 +51,7 @@ const char *GetVersionString(); // Version identifier for network games. // Bump it every time you do a release unless you're certain you // didn't change anything that will affect sync. -#define NETGAMEVERSION 229 +#define NETGAMEVERSION 230 // Version stored in the ini's [LastRun] section. // Bump it if you made some configuration change that you want to @@ -61,11 +61,11 @@ const char *GetVersionString(); // Protocol version used in demos. // Bump it if you change existing DEM_ commands or add new ones. // Otherwise, it should be safe to leave it alone. -#define DEMOGAMEVERSION 0x21A +#define DEMOGAMEVERSION 0x21B // Minimum demo version we can play. // Bump it whenever you change or remove existing DEM_ commands. -#define MINDEMOVERSION 0x215 +#define MINDEMOVERSION 0x21B // SAVEVER is the version of the information stored in level snapshots. // Note that SAVEVER is not directly comparable to VERSION. @@ -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 4509 +#define SAVEVER 4510 #define SAVEVERSTRINGIFY2(x) #x #define SAVEVERSTRINGIFY(x) SAVEVERSTRINGIFY2(x) diff --git a/wadsrc/static/menudef.txt b/wadsrc/static/menudef.txt index 71aeb9ae5..7099e6cc7 100644 --- a/wadsrc/static/menudef.txt +++ b/wadsrc/static/menudef.txt @@ -1157,7 +1157,7 @@ OptionValue FallingDM 3, "Strife" } -OptionValue JumpCrouch +OptionValue JumpCrouchFreeLook { 0, "Default" 1, "Off" @@ -1189,9 +1189,9 @@ OptionMenu GameplayOptions Option "Degeneration", "sv_degeneration", "YesNo" Option "Allow Autoaim", "sv_noautoaim", "NoYes" Option "Allow Suicide", "sv_disallowsuicide", "NoYes" - Option "Allow jump", "sv_jump", "JumpCrouch" - Option "Allow crouch", "sv_crouch", "JumpCrouch" - Option "Allow freelook", "sv_nofreelook", "NoYes" + Option "Allow jump", "sv_jump", "JumpCrouchFreeLook" + Option "Allow crouch", "sv_crouch", "JumpCrouchFreeLook" + Option "Allow freelook", "sv_freelook", "JumpCrouchFreeLook" Option "Allow FOV", "sv_nofov", "NoYes" Option "Allow BFG aiming", "sv_nobfgaim", "NoYes" Option "Allow automap", "sv_noautomap", "NoYes" From 6d4eb7f62d73cd9ea7ea7630b5af3d588a45b5d6 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 27 Jul 2014 10:07:37 +0200 Subject: [PATCH 4/5] - changed handling of DF_NO_COOP_WEAPON_SPAWN dmflag so that weapons are not determined by class type but by a newly added flag WEAPONSPAWN, to allow CustomInventory replacements to act like weapons when being spawned. --- src/actor.h | 1 + src/p_mobj.cpp | 2 +- src/thingdef/thingdef_data.cpp | 1 + wadsrc/static/actors/shared/inventory.txt | 6 +++++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/actor.h b/src/actor.h index 0dd20c14f..4c2952639 100644 --- a/src/actor.h +++ b/src/actor.h @@ -340,6 +340,7 @@ enum MF7_NOTELESTOMP = 0x00000002, // cannot telefrag under any circumstances (even when set by MAPINFO) MF7_ALWAYSTELEFRAG = 0x00000004, // will unconditionally be telefragged when in the way. Overrides all other settings. MF7_HANDLENODELAY = 0x00000008, // respect NoDelay state flag + MF7_WEAPONSPAWN = 0x00000010, // subject to DF_NO_COOP_WEAPON_SPAWN dmflag // --- mobj.renderflags --- diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 076d106eb..cdc511d11 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -4724,7 +4724,7 @@ AActor *P_SpawnMapThing (FMapThing *mthing, int position) // [RH] don't spawn extra weapons in coop if so desired if (multiplayer && !deathmatch && (dmflags & DF_NO_COOP_WEAPON_SPAWN)) { - if (i->IsDescendantOf (RUNTIME_CLASS(AWeapon))) + if (GetDefaultByType(i)->flags7 & MF7_WEAPONSPAWN) { if ((mthing->flags & (MTF_DEATHMATCH|MTF_SINGLE)) == MTF_DEATHMATCH) return NULL; diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index bf0bf2e13..013415cc7 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -240,6 +240,7 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF7, NEVERTARGET, AActor, flags7), DEFINE_FLAG(MF7, NOTELESTOMP, AActor, flags7), DEFINE_FLAG(MF7, ALWAYSTELEFRAG, AActor, flags7), + DEFINE_FLAG(MF7, WEAPONSPAWN, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects), diff --git a/wadsrc/static/actors/shared/inventory.txt b/wadsrc/static/actors/shared/inventory.txt index ed113c4df..e293282b8 100644 --- a/wadsrc/static/actors/shared/inventory.txt +++ b/wadsrc/static/actors/shared/inventory.txt @@ -335,6 +335,7 @@ Actor Weapon : Inventory native Weapon.BobSpeed 1.0 Weapon.BobRangeX 1.0 Weapon.BobRangeY 1.0 + +WEAPONSPAWN States { LightDone: @@ -362,4 +363,7 @@ Actor WeaponHolder : Inventory native +INVENTORY.UNDROPPABLE } -Actor WeaponPiece : Inventory native {} +Actor WeaponPiece : Inventory native +{ + +WEAPONSPAWN +} From 993b6c30665f6ef11d5808dd574a824c07b58a63 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 28 Jul 2014 17:13:42 +0200 Subject: [PATCH 5/5] - fixed typo in FraggleScript item class list --- src/fragglescript/t_func.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fragglescript/t_func.cpp b/src/fragglescript/t_func.cpp index 32d4909d4..4825fe06b 100644 --- a/src/fragglescript/t_func.cpp +++ b/src/fragglescript/t_func.cpp @@ -154,7 +154,7 @@ static const char * const ActorNames_init[]= "RocketAmmo", "RocketBox", "Cell", - "CellBox", + "CellPack", "Shell", "ShellBox", "Backpack",