# HG changeset patch # User Adam Kaminski # Date 1604088699 14400 # Fri Oct 30 16:11:39 2020 -0400 # Node ID 6967d4aa7faa9d20d75a656171d95f88706c1b78 # Parent 3eb28b1ecad3101d92cb2ccc4013d1309d60d259 Added new compatibility flag "compat_resetglobalvarsonmapreset" to reset all global ACS variables upon resetting the map like in survival. diff -r 3eb28b1ecad3 -r 6967d4aa7faa docs/zandronum-history.txt --- a/docs/zandronum-history.txt Fri Oct 30 12:42:44 2020 -0400 +++ b/docs/zandronum-history.txt Fri Oct 30 16:11:39 2020 -0400 @@ -25,6 +25,7 @@ + - Added ACS function: SetPlayerClass(int player, str class, bool respawn) to allow changing of a player's class. [Kaminsky] + - Added new SBARINFO command: IfSpectator [not] [dead], that executes a sub block if the local player is (not) a (dead) spectator. [Kaminsky] + - Added a new scoreboard icon that displays if a player is lagging to the server. [Kaminsky] ++ - Added new compatibility flag "compat_resetglobalvarsonmapreset" to reset all global ACS variables upon resetting the map like in survival. [Kaminsky] - - Fixed: Bots tries to jump to reach item when sv_nojump is true. [sleep] - - Fixed: ACS function SetSkyScrollSpeed didn't work online. [Edward-san] - - Fixed: color codes in callvote reasons weren't terminated properly. [Dusk] diff -r 3eb28b1ecad3 -r 6967d4aa7faa src/d_main.cpp --- a/src/d_main.cpp Fri Oct 30 12:42:44 2020 -0400 +++ b/src/d_main.cpp Fri Oct 30 16:11:39 2020 -0400 @@ -814,6 +814,7 @@ CVAR (Flag, compat_autoaim, zacompatflags, ZACOMPATF_AUTOAIM); CVAR (Flag, compat_silentwestspawns, zacompatflags, ZACOMPATF_SILENT_WEST_SPAWNS); CVAR (Flag, compat_skulltagjumping, zacompatflags, ZACOMPATF_SKULLTAG_JUMPING); +CVAR (Flag, compat_resetglobalvarsonmapreset, zacompatflags, ZACOMPATF_RESET_GLOBALVARS_ON_MAPRESET); //========================================================================== // diff -r 3eb28b1ecad3 -r 6967d4aa7faa src/doomdef.h --- a/src/doomdef.h Fri Oct 30 12:42:44 2020 -0400 +++ b/src/doomdef.h Fri Oct 30 16:11:39 2020 -0400 @@ -466,6 +466,8 @@ ZACOMPATF_SILENT_WEST_SPAWNS = 1 << 11, // [BB] Restore the jumping behavior known from Skulltag. This reverts the jumping change from ZDoom SVN revision 2970. ZACOMPATF_SKULLTAG_JUMPING = 1 << 12, + // [AK] World and global-scope ACS variables/arrays will be reset upon resetting the map like in survival. + ZACOMPATF_RESET_GLOBALVARS_ON_MAPRESET = 1 << 13, // Limited movement in the air. ZACOMPATF_LIMITED_AIRMOVEMENT = 1 << 17, diff -r 3eb28b1ecad3 -r 6967d4aa7faa src/g_game.cpp --- a/src/g_game.cpp Fri Oct 30 12:42:44 2020 -0400 +++ b/src/g_game.cpp Fri Oct 30 16:11:39 2020 -0400 @@ -3379,6 +3379,9 @@ pActor->args[i] = pActor->SavedArgs[i]; } + // [AK] Reset the world and global ACS variables on the clients if ZACOMPATF_RESET_GLOBALVARS_ON_MAPRESET is on. + if ( zacompatflags & ZACOMPATF_RESET_GLOBALVARS_ON_MAPRESET ) + P_ClearACSVars( true ); // [BB] Clients may be running CLIENTSIDE scripts, so we also need to reset ACS scripts on the clients. GAME_ResetScripts ( ); return; @@ -4089,6 +4092,10 @@ if ( NETWORK_GetState( ) == NETSTATE_SERVER ) SERVERCOMMANDS_DestroyAllSectorMovers( ); + // [AK] Reset all world and global ACS variables if ZACOMPATF_RESET_GLOBALVARS_ON_MAPRESET is on. + if ( zacompatflags & ZACOMPATF_RESET_GLOBALVARS_ON_MAPRESET ) + P_ClearACSVars( true ); + // [BB] Reset all ACS scripts. GAME_ResetScripts ( ); diff -r 3eb28b1ecad3 -r 6967d4aa7faa wadsrc/static/menudef.txt --- a/wadsrc/static/menudef.txt Fri Oct 30 12:42:44 2020 -0400 +++ b/wadsrc/static/menudef.txt Fri Oct 30 16:11:39 2020 -0400 @@ -1448,6 +1448,7 @@ Option "Auto-aiming has vertical holes", "compat_autoaim", "YesNo" Option "West facing spawns are silent", "compat_silentwestspawns", "YesNo" Option "Use old Skulltag jumping behavior", "compat_skulltagjumping", "YesNo" + Option "Reset global ACS variables upon map reset", "compat_resetglobalvarsonmapreset", "YesNo" Class "CompatibilityMenu" }