From 5716dfe0502073ac7d7bd67a02ec166df3c51247 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Fri, 10 Nov 2017 08:21:28 -0500 Subject: [PATCH 1/5] - put limits on A_SoundVolume --- src/s_sound.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/s_sound.cpp b/src/s_sound.cpp index ea12fe97e..fede842b1 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -1761,6 +1761,12 @@ void S_RelinkSound (AActor *from, AActor *to) bool S_ChangeSoundVolume(AActor *actor, int channel, float volume) { + // don't let volume get out of bounds + if (volume < 0.0) + volume = 0.0; + else if (volume > 1.0) + volume = 1.0; + for (FSoundChan *chan = Channels; chan != NULL; chan = chan->NextChan) { if (chan->SourceType == SOURCE_Actor && From cdf0733c8bee50f551b2e9e2a85303708d85061d Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 11 Nov 2017 09:37:41 -0500 Subject: [PATCH 2/5] - added latching CVARs to CVARINFO --- src/d_main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d_main.cpp b/src/d_main.cpp index 06a772066..29cc82a16 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1439,6 +1439,10 @@ void ParseCVarInfo() { cvarflags |= CVAR_CHEAT; } + else if (stricmp(sc.String, "latch") == 0) + { + cvarflags |= CVAR_LATCH; + } else { sc.ScriptError("Unknown cvar attribute '%s'", sc.String); From 1088c60add8f278af21dff564317da5ebd5c8242 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Sat, 11 Nov 2017 15:54:42 -0500 Subject: [PATCH 3/5] - add doom e1m6 to rebuildnodes list. https://forum.zdoom.org/viewtopic.php?f=15&t=58430 --- wadsrc/static/compatibility.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/compatibility.txt b/wadsrc/static/compatibility.txt index ee676b051..f76ffebf6 100644 --- a/wadsrc/static/compatibility.txt +++ b/wadsrc/static/compatibility.txt @@ -345,6 +345,7 @@ F481922F4881F74760F3C0437FD5EDD0 // map03 8B2AC8D4DB4A49A5DCCBB067E04434D6 // The Hell Factory Hub One, map04 65A1EB4C87386F290816660A52932FF1 // Master Levels, garrison.wad 3DEE4EFEFAF3260C800A30734F54CE75 // Hellbound, map14 +5FAA25F5A6AAB3409CAE0AF87F910341 // DOOM.wad e1m6 { rebuildnodes } From 285834ae5b66eb66723a8b430ef65997cf1c7ba6 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 12 Nov 2017 11:03:08 +0200 Subject: [PATCH 4/5] Fixed return state of player entered event https://forum.zdoom.org/viewtopic.php?t=58433 --- src/g_level.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/g_level.cpp b/src/g_level.cpp index d5044942e..701d35b53 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -128,7 +128,7 @@ int starttime; extern FString BackupSaveName; bool savegamerestore; -int finishstate; +int finishstate = FINISH_NoHub; extern int mousex, mousey; extern bool sendpause, sendsave, sendturn180, SendLand; @@ -851,6 +851,8 @@ void G_DoCompleted (void) level.maptime = 0; } + finishstate = mode; + if (!deathmatch && ((level.flags & LEVEL_NOINTERMISSION) || ((nextcluster == thiscluster) && (thiscluster->flags & CLUSTER_HUB) && !(thiscluster->flags & CLUSTER_ALLOWINTERMISSION)))) @@ -860,7 +862,6 @@ void G_DoCompleted (void) } gamestate = GS_INTERMISSION; - finishstate = mode; viewactive = false; automapactive = false; @@ -1038,12 +1039,20 @@ void G_DoLoadLevel (int position, bool autosave) { players[ii].camera = players[ii].mo; } - if (!savegamerestore) + + if (savegamerestore) { - E_PlayerEntered(ii, finishstate == FINISH_SameHub); + continue; + } + + const bool fromSnapshot = level.FromSnapshot; + E_PlayerEntered(ii, fromSnapshot && finishstate == FINISH_SameHub); + + if (fromSnapshot) + { + // ENTER scripts are being handled when the player gets spawned, this cannot be changed due to its effect on voodoo dolls. + FBehavior::StaticStartTypedScripts(SCRIPT_Return, players[ii].mo, true); } - // ENTER scripts are being handled when the player gets spawned, this cannot be changed due to its effect on voodoo dolls. - if (level.FromSnapshot && !savegamerestore) FBehavior::StaticStartTypedScripts(SCRIPT_Return, players[ii].mo, true); } } From 5d83ee5e891d4da3be95a1d7eb9f74e69f856786 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 12 Nov 2017 14:44:21 +0200 Subject: [PATCH 5/5] Exposed String.Remove() function to ZScript https://forum.zdoom.org/viewtopic.php?t=58402 --- src/scripting/thingdef_data.cpp | 9 +++++++++ wadsrc/static/zscript/base.txt | 1 + 2 files changed, 10 insertions(+) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index 540b61a36..c746c536d 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -1225,6 +1225,15 @@ DEFINE_ACTION_FUNCTION(FStringStruct, Truncate) return 0; } +DEFINE_ACTION_FUNCTION(FStringStruct, Remove) +{ + PARAM_SELF_STRUCT_PROLOGUE(FString); + PARAM_UINT(index); + PARAM_UINT(remlen); + self->Remove(index, remlen); + return 0; +} + // CharAt and CharCodeAt is how JS does it, and JS is similar here in that it doesn't have char type as int. DEFINE_ACTION_FUNCTION(FStringStruct, CharAt) { diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index 9cba0cb09..89dd0ab7d 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -684,6 +684,7 @@ struct StringStruct native native String Left(int len) const; native String Mid(int pos = 0, int len = 2147483647) const; native void Truncate(int newlen); + native void Remove(int index, int remlen); native String CharAt(int pos) const; native int CharCodeAt(int pos) const; native String Filter();