From 3e517ad4d0b1d089841cafe50dc4f5dc062250c1 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sat, 24 Oct 2015 11:58:32 +0300 Subject: [PATCH 1/3] Fixed selection of empty items in Video Mode menu See http://forum.zdoom.org/viewtopic.php?t=49794 --- src/menu/optionmenuitems.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/menu/optionmenuitems.h b/src/menu/optionmenuitems.h index e87e78483e..a1fff64c72 100644 --- a/src/menu/optionmenuitems.h +++ b/src/menu/optionmenuitems.h @@ -942,6 +942,14 @@ public: { return mMaxValid >= 0; } + + void Ticker() + { + if (Selectable() && mSelection > mMaxValid) + { + mSelection = mMaxValid; + } + } }; From b22a909829af8869903943c85c45833b2bf788e6 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 27 Jan 2016 13:08:23 -0600 Subject: [PATCH 2/3] Add nodelay handling to FastProjectile --- src/g_shared/a_fastprojectile.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/g_shared/a_fastprojectile.cpp b/src/g_shared/a_fastprojectile.cpp index ae7f6a58b0..725b858e33 100644 --- a/src/g_shared/a_fastprojectile.cpp +++ b/src/g_shared/a_fastprojectile.cpp @@ -138,6 +138,17 @@ void AFastProjectile::Tick () } } } + if ((flags7 & MF7_HANDLENODELAY) && !(flags2 & MF2_DORMANT)) + { + flags7 &= ~MF7_HANDLENODELAY; + if (state->GetNoDelay()) + { + // For immediately spawned objects with the NoDelay flag set for their + // Spawn state, explicitly call the current state's function. + if (state->CallAction(this, this) && (ObjectFlags & OF_EuthanizeMe)) + return; // freed itself + } + } // Advance the state if (tics != -1) { From 2d40874cfa4800eca6eda4c7c8250cb92fbdc828 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Wed, 27 Jan 2016 13:19:15 -0600 Subject: [PATCH 3/3] Make finishgame CCMD net-aware --- src/d_net.cpp | 5 +++++ src/d_protocol.h | 3 ++- src/statistics.cpp | 3 ++- src/version.h | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/d_net.cpp b/src/d_net.cpp index 5e8a635d5e..640ba4580f 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -2668,6 +2668,11 @@ void Net_DoCommand (int type, BYTE **stream, int player) players[player].camera = players[player].mo; break; + case DEM_FINISHGAME: + // Simulate an end-of-game action + G_ChangeLevel(NULL, 0, 0); + break; + default: I_Error ("Unknown net command: %d", type); break; diff --git a/src/d_protocol.h b/src/d_protocol.h index 73b042470e..ef8fe26625 100644 --- a/src/d_protocol.h +++ b/src/d_protocol.h @@ -164,7 +164,8 @@ enum EDemoCommand DEM_RUNNAMEDSCRIPT, // 65 String: Script name, Byte: Arg count + Always flag; each arg is a 4-byte int DEM_REVERTCAMERA, // 66 DEM_SETSLOTPNUM, // 67 Byte: player number, the rest is the same as DEM_SETSLOT - DEM_REMOVE, // 68 + DEM_REMOVE, // 68 + DEM_FINISHGAME, // 69 }; // The following are implemented by cht_DoCheat in m_cheat.cpp diff --git a/src/statistics.cpp b/src/statistics.cpp index 7ed6e7f8ec..d611fdc0c9 100644 --- a/src/statistics.cpp +++ b/src/statistics.cpp @@ -46,6 +46,7 @@ #include "c_console.h" #include "d_gui.h" #include "d_dehacked.h" +#include "d_net.h" #include "g_game.h" #include "m_png.h" #include "m_misc.h" @@ -604,7 +605,7 @@ CCMD(printstats) CCMD(finishgame) { // This CCMD simulates an end-of-game action and exists to end mods that never exit their last level. - G_ChangeLevel(NULL, 0, 0); + Net_WriteByte(DEM_FINISHGAME); } ADD_STAT(statistics) diff --git a/src/version.h b/src/version.h index b8c4facb0d..167f8a3036 100644 --- a/src/version.h +++ b/src/version.h @@ -61,7 +61,7 @@ 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 0x21C +#define DEMOGAMEVERSION 0x21D // Minimum demo version we can play. // Bump it whenever you change or remove existing DEM_ commands.