diff --git a/src/am_map.cpp b/src/am_map.cpp index 540461441..2d80b59a0 100644 --- a/src/am_map.cpp +++ b/src/am_map.cpp @@ -109,7 +109,10 @@ CUSTOM_CVAR (Int, am_emptyspacemargin, 0, CVAR_ARCHIVE) self = 90; } - AM_NewResolution(); + if (nullptr != StatusBar) + { + AM_NewResolution(); + } } //============================================================================= diff --git a/src/c_dispatch.cpp b/src/c_dispatch.cpp index 1bca9051b..2ab57ab7e 100644 --- a/src/c_dispatch.cpp +++ b/src/c_dispatch.cpp @@ -191,9 +191,11 @@ static const char *MenuDefCommands[] = { "snd_reset", "reset2defaults", + "reset2saved", "menuconsole", "clearnodecache", "am_restorecolors", + "undocolorpic", "special", "puke", "fpuke", diff --git a/src/d_main.cpp b/src/d_main.cpp index 6247a5339..656a2ca3b 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -797,7 +797,13 @@ void D_Display () case GS_LEVEL: case GS_TITLELEVEL: if (!gametic) + { + if (!screen->HasBegun2D()) + { + screen->Begin2D(false); + } break; + } if (StatusBar != NULL) { diff --git a/src/p_setup.cpp b/src/p_setup.cpp index ea8b69649..b87bf6b87 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3815,8 +3815,6 @@ void P_SetupLevel (const char *lumpname, int position) P_LoadThings (map); else P_LoadThings2 (map); // [RH] Load Hexen-style things - - SetCompatibilityParams(); } else { @@ -3825,6 +3823,8 @@ void P_SetupLevel (const char *lumpname, int position) times[0].Unclock(); } + SetCompatibilityParams(); + times[6].Clock(); P_LoopSidedefs (true); times[6].Unclock(); diff --git a/src/scripting/backend/codegen.cpp b/src/scripting/backend/codegen.cpp index 564240203..d504282d1 100644 --- a/src/scripting/backend/codegen.cpp +++ b/src/scripting/backend/codegen.cpp @@ -8091,7 +8091,7 @@ FxExpression *FxMemberFunctionCall::Resolve(FCompileContext& ctx) { bool error; PFunction *afd = FindClassMemberFunction(ccls, ctx.Class, MethodName, ScriptPosition, &error); - if ((afd->Variants[0].Flags & VARF_Method) && (afd->Variants[0].Flags & VARF_Virtual)) + if ((nullptr != afd) && (afd->Variants[0].Flags & VARF_Method) && (afd->Variants[0].Flags & VARF_Virtual)) { staticonly = false; novirtual = true; diff --git a/src/v_draw.cpp b/src/v_draw.cpp index 37648112f..fc592949c 100644 --- a/src/v_draw.cpp +++ b/src/v_draw.cpp @@ -959,6 +959,19 @@ void DCanvas::DrawLine(int x0, int y0, int x1, int y1, int palColor, uint32_t re #endif } +DEFINE_ACTION_FUNCTION(_Screen, DrawLine) +{ + PARAM_PROLOGUE; + PARAM_INT(x0); + PARAM_INT(y0); + PARAM_INT(x1); + PARAM_INT(y1); + PARAM_INT(color); + if (!screen->HasBegun2D()) ThrowAbortException(X_OTHER, "Attempt to draw to screen outside a draw function"); + screen->DrawLine(x0, y0, x1, y1, -1, color); + return 0; +} + void DCanvas::DrawPixel(int x, int y, int palColor, uint32_t realcolor) { #ifndef NO_SWRENDER diff --git a/wadsrc/static/zscript/base.txt b/wadsrc/static/zscript/base.txt index e38517142..89eea6bde 100644 --- a/wadsrc/static/zscript/base.txt +++ b/wadsrc/static/zscript/base.txt @@ -168,6 +168,7 @@ struct Screen native native static vararg void DrawTexture(TextureID tex, bool animate, double x, double y, ...); native static vararg void DrawChar(Font font, int normalcolor, double x, double y, int character, ...); native static vararg void DrawText(Font font, int normalcolor, double x, double y, String text, ...); + native static void DrawLine(int x0, int y0, int x1, int y1, Color color); native static void DrawFrame(int x, int y, int w, int h); native static Vector2, Vector2 VirtualToRealCoords(Vector2 pos, Vector2 size, Vector2 vsize, bool vbottom=false, bool handleaspect=true); native static double GetAspectRatio(); diff --git a/wadsrc/static/zscript/shared/player_cheat.txt b/wadsrc/static/zscript/shared/player_cheat.txt index 15bad043c..949c89a3c 100644 --- a/wadsrc/static/zscript/shared/player_cheat.txt +++ b/wadsrc/static/zscript/shared/player_cheat.txt @@ -272,7 +272,7 @@ extend class PlayerPawn if (type != null && type is deletetype) { let pack = FindInventory(type); - if (pack) pack.Destroy(); + if (pack) pack.DepleteOrDestroy(); } } }