From 1bcbdf9fd1d6be4c67780392f72087a14082ee8b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 20 Feb 2018 10:51:12 +0200 Subject: [PATCH 1/6] Added CHAN_LOOP to ZScript ESoundFlags enum https://forum.zdoom.org/viewtopic.php?t=59417 --- wadsrc/static/zscript/constants.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/wadsrc/static/zscript/constants.txt b/wadsrc/static/zscript/constants.txt index 47cf4accd..ef20e2310 100644 --- a/wadsrc/static/zscript/constants.txt +++ b/wadsrc/static/zscript/constants.txt @@ -416,6 +416,7 @@ enum ESoundFlags CHAN_MAYBE_LOCAL = 16, CHAN_UI = 32, CHAN_NOPAUSE = 64, + CHAN_LOOP = 256, CHAN_PICKUP = (CHAN_ITEM|CHAN_MAYBE_LOCAL), CHAN_NOSTOP = 4096 From 117b796c6b4333df247b95aa017417d642b6f875 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 20 Feb 2018 04:44:36 -0500 Subject: [PATCH 2/6] - fixed: Phobia: The Age (or any mod with DEHACKED overriding player bits) overwrote the player's Friendly flag --- src/d_dehacked.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/d_dehacked.cpp b/src/d_dehacked.cpp index cd6525304..92d574d69 100644 --- a/src/d_dehacked.cpp +++ b/src/d_dehacked.cpp @@ -1196,6 +1196,10 @@ static int PatchThing (int thingy) // triggering line effects and can teleport when the missile flag is removed. info->flags2 &= ~MF2_NOTELEPORT; } + if (thingy == 1) // [SP] special handling for players - always be friendly! + { + value[0] |= MF_FRIENDLY; + } info->flags = ActorFlags::FromInt (value[0]); } if (vchanged[1]) From ff897997d6f9a29168000244b37eed76ab6aa855 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Tue, 20 Feb 2018 12:20:18 +0200 Subject: [PATCH 3/6] Fixed hang when TiMidity++ executable failed to launch https://forum.zdoom.org/viewtopic.php?t=59539 --- src/sound/mididevices/music_timiditypp_mididevice.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index 42733ce38..a254776ec 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -692,6 +692,10 @@ bool TimidityPPMIDIDevice::FillStream(SoundStream *stream, void *buff, int len, } break; } + else if (r == 0 && errno != 0) + { + break; + } got += r; } while(got < len); if(got < len) From 420602e15402a56e857f0eff6b1c8bb0ec129664 Mon Sep 17 00:00:00 2001 From: Rachael Alexanderson Date: Tue, 20 Feb 2018 05:35:18 -0500 Subject: [PATCH 4/6] - check for deathmatch starts before forcing an unfriendly player to use them. --- src/p_setup.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 937f77fa8..4f2a64bde 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -4138,15 +4138,18 @@ void P_SetupLevel (const char *lumpname, int position) // [SP] move unfriendly players around // horribly hacky - yes, this needs rewritten. - for (i = 0; i < MAXPLAYERS; ++i) + if (level.deathmatchstarts.Size () > 0) { - if (playeringame[i] && players[i].mo != NULL) + for (i = 0; i < MAXPLAYERS; ++i) { - if (!(players[i].mo->flags & MF_FRIENDLY)) + if (playeringame[i] && players[i].mo != NULL) { - AActor * oldSpawn = players[i].mo; - G_DeathMatchSpawnPlayer (i); - oldSpawn->Destroy(); + if (!(players[i].mo->flags & MF_FRIENDLY)) + { + AActor * oldSpawn = players[i].mo; + G_DeathMatchSpawnPlayer (i); + oldSpawn->Destroy(); + } } } } From 74357ced0c0ee2e78d6b68af8116c158111c7a27 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 21 Feb 2018 15:17:02 +0200 Subject: [PATCH 5/6] Fixed read of potentially junk values in ZScript parser The following ill-formed ZScript code might crash targets with sizeof(int) != sizeof(void*) like 64-bit Intel class test { void func() { if (true) ( return; ) } } --- src/scripting/zscript/zcc_parser.cpp | 1 + src/scripting/zscript/zcc_parser.h | 20 ++++++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/scripting/zscript/zcc_parser.cpp b/src/scripting/zscript/zcc_parser.cpp index cb927bb50..02d78021b 100644 --- a/src/scripting/zscript/zcc_parser.cpp +++ b/src/scripting/zscript/zcc_parser.cpp @@ -267,6 +267,7 @@ static void ParseSingleFile(FScanner *pSC, const char *filename, int lump, void while (sc.GetToken()) { + value.Largest = 0; value.SourceLoc = sc.GetMessageLine(); switch (sc.TokenType) { diff --git a/src/scripting/zscript/zcc_parser.h b/src/scripting/zscript/zcc_parser.h index 3c1e55805..5f0889fd2 100644 --- a/src/scripting/zscript/zcc_parser.h +++ b/src/scripting/zscript/zcc_parser.h @@ -7,11 +7,31 @@ struct ZCCToken { + template + struct TLargest; + + template + struct TLargest + { + using Type = T; + }; + + template + struct TLargest + { + using Type = typename TLargest< + typename std::conditional< + (sizeof(T) > sizeof(U)), T, U + >::type, Ts... + >::Type; + }; + union { int Int; double Float; FString *String; + TLargest::Type Largest; }; int SourceLoc; From 9bf11155eb0b8635dd8489928387d265097316cd Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 22 Feb 2018 08:40:32 +0100 Subject: [PATCH 6/6] Ignore .DS_Store for macOS --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 80c2238ae..85af54469 100644 --- a/.gitignore +++ b/.gitignore @@ -54,3 +54,4 @@ .vs /src/gl/unused /mapfiles_release/*.map +.DS_Store