diff --git a/source/build/include/build.h b/source/build/include/build.h index 7ec95e0aa..754128cfd 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -186,6 +186,7 @@ inline walltype* sectortype::firstWall() const extern sectortype sectorbackup[MAXSECTORS]; extern walltype wallbackup[MAXWALLS]; +extern bool inpreparemirror; inline tspriteptr_t renderAddTSpriteFromSprite(spritetype* tsprite, int& spritesortcnt, uint16_t const spritenum) { diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index db7cfbe42..657f4e18b 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -154,7 +154,7 @@ int16_t pointhighlight=-1, linehighlight=-1, highlightcnt=0; static int16_t numhits; -char inpreparemirror = 0; +bool inpreparemirror = 0; // diff --git a/source/build/src/engine_priv.h b/source/build/src/engine_priv.h index 6c094d2be..4613b9fbb 100644 --- a/source/build/src/engine_priv.h +++ b/source/build/src/engine_priv.h @@ -28,8 +28,6 @@ extern int16_t globalpicnum; extern int32_t globalorientation; -extern char inpreparemirror; - extern int32_t hitallsprites; int32_t animateoffs(int tilenum, int fakevar); diff --git a/source/common/cutscenes/screenjob.cpp b/source/common/cutscenes/screenjob.cpp index 4ac10b593..5bbf44bcd 100644 --- a/source/common/cutscenes/screenjob.cpp +++ b/source/common/cutscenes/screenjob.cpp @@ -89,12 +89,14 @@ void Job_Init() VMFunction* LookupFunction(const char* qname, bool validate) { size_t p = strcspn(qname, "."); - if (p == 0) I_Error("Call to undefined function %s", qname); + if (p == 0) + I_Error("Call to undefined function %s", qname); FString clsname(qname, p); FString funcname = qname + p + 1; auto func = PClass::FindFunction(clsname, funcname); - if (func == nullptr) I_Error("Call to undefined function %s", qname); + if (func == nullptr) + I_Error("Call to undefined function %s", qname); if (validate) { // these conditions must be met by all functions for this interface. diff --git a/source/common/menu/menudef.cpp b/source/common/menu/menudef.cpp index f22f9f9b7..7a3758e64 100644 --- a/source/common/menu/menudef.cpp +++ b/source/common/menu/menudef.cpp @@ -340,6 +340,10 @@ static void DoParseListMenuBody(FScanner &sc, DListMenuDescriptor *desc, bool &s { desc->mCenter = true; } + else if (sc.Compare("Selecteditem")) + { + desc->mSelectedItem = desc->mItems.Size() - 1; + } else if (sc.Compare("animatedtransition")) { desc->mAnimatedTransition = true; diff --git a/source/core/automap.cpp b/source/core/automap.cpp index 0007e6593..725f0cf5b 100644 --- a/source/core/automap.cpp +++ b/source/core/automap.cpp @@ -540,9 +540,9 @@ void DrawPlayerArrow(int cposx, int cposy, int cang, int pl_x, int pl_y, int zoo int py2 = DMulScale(arrow[i + 3], pxvect, arrow[i+2], pyvect, 16) + (height << 11); int ox1 = px1 - cposx; - int oy1 = py1 - cposx; + int oy1 = py1 - cposy; int ox2 = px2 - cposx; - int oy2 = py2 - cposx; + int oy2 = py2 - cposy; int sx1 = DMulScale(ox1, xvect, -oy1, yvect, 16) + (width << 11); int sy1 = DMulScale(oy1, xvect, ox1, yvect, 16) + (height << 11); diff --git a/source/core/d_protocol.cpp b/source/core/d_protocol.cpp index 7b5972ee1..1938c2fd0 100644 --- a/source/core/d_protocol.cpp +++ b/source/core/d_protocol.cpp @@ -374,7 +374,15 @@ void RunNetSpecs (int player, int buf) while (stream < end) { int type = ReadByte (&stream); - Net_DoCommand (type, &stream, player); + try + { + Net_DoCommand(type, &stream, player); + } + catch (...) + { + NetSpecs[player][buf].SetData(NULL, 0); + throw; + } } #if 0 if (!demorecording) diff --git a/source/core/gamecvars.h b/source/core/gamecvars.h index 2bf23359f..82136c02d 100644 --- a/source/core/gamecvars.h +++ b/source/core/gamecvars.h @@ -16,6 +16,7 @@ EXTERN_CVAR(Bool, cl_weaponsway) EXTERN_CVAR(Bool, cl_viewhbob) EXTERN_CVAR(Bool, cl_viewvbob) EXTERN_CVAR(Bool, cl_interpolate) +EXTERN_CVAR(Bool, cl_capfps) EXTERN_CVAR(Bool, cl_slopetilting) EXTERN_CVAR(Int, cl_showweapon) EXTERN_CVAR(Int, cl_weaponswitch) diff --git a/source/core/menu/razemenu.cpp b/source/core/menu/razemenu.cpp index cc4c7bd5d..37cd6c150 100644 --- a/source/core/menu/razemenu.cpp +++ b/source/core/menu/razemenu.cpp @@ -456,7 +456,8 @@ static void BuildEpisodeMenu() // Build skill menu int addedSkills = 0; desc = MenuDescriptors.CheckKey(NAME_Skillmenu); - if (desc != nullptr && (*desc)->IsKindOf(RUNTIME_CLASS(DListMenuDescriptor))) + // If the skill names list ios empty, a predefined menu is assumed + if (desc != nullptr && gSkillNames[0].IsNotEmpty() && (*desc)->IsKindOf(RUNTIME_CLASS(DListMenuDescriptor))) { DListMenuDescriptor* ld = static_cast(*desc); DMenuItemBase* popped = nullptr; diff --git a/source/core/nodebuilder/nodebuild_utility.cpp b/source/core/nodebuilder/nodebuild_utility.cpp index f7df707ae..7169d2569 100644 --- a/source/core/nodebuilder/nodebuild_utility.cpp +++ b/source/core/nodebuilder/nodebuild_utility.cpp @@ -358,16 +358,13 @@ void FNodeBuilder::FLevel::FindMapBounds() minx = maxx = Vertices[0].fX(); miny = maxy = Vertices[0].fY(); - for (int i = 1; i < NumLines; ++i) + for (int i = 1; i < NumVertices; ++i) { - for (int j = 0; j < 2; j++) - { - vertex_t *v = (j == 0 ? Lines[i].v1 : Lines[i].v2); - if (v->fX() < minx) minx = v->fX(); - else if (v->fX() > maxx) maxx = v->fX(); - if (v->fY() < miny) miny = v->fY(); - else if (v->fY() > maxy) maxy = v->fY(); - } + vertex_t* v = &Vertices[i]; + if (v->fX() < minx) minx = v->fX(); + else if (v->fX() > maxx) maxx = v->fX(); + if (v->fY() < miny) miny = v->fY(); + else if (v->fY() > maxy) maxy = v->fY(); } MinX = FLOAT2FIXED(minx); diff --git a/source/core/razefont.cpp b/source/core/razefont.cpp index 0b6589f22..68dc874b3 100644 --- a/source/core/razefont.cpp +++ b/source/core/razefont.cpp @@ -106,6 +106,9 @@ void InitFont() BigFont = new FFont(0, "BigFont"); BigFont->CopyFrom(*BigFont15); } + if (!BigFont) BigFont = ConFont; + if (!SmallFont) SmallFont = ConFont; + OriginalSmallFont = SmallFont; OriginalBigFont = BigFont; } diff --git a/source/core/rendering/scene/hw_drawinfo.cpp b/source/core/rendering/scene/hw_drawinfo.cpp index b02f01a15..bb6804160 100644 --- a/source/core/rendering/scene/hw_drawinfo.cpp +++ b/source/core/rendering/scene/hw_drawinfo.cpp @@ -302,7 +302,6 @@ void HWDrawInfo::DispatchSprites() { HWSprite hwsprite; int num = tiletovox[tilenum]; - if (num != 435) Printf("%d - %d\n", tilenum, num); if (hwsprite.ProcessVoxel(this, voxmodels[num], tspr, §or[tspr->sectnum], voxrotate[num])) continue; } diff --git a/source/core/screenjob.cpp b/source/core/screenjob.cpp index 871fddca5..0225552b6 100644 --- a/source/core/screenjob.cpp +++ b/source/core/screenjob.cpp @@ -91,6 +91,7 @@ static void CallCreateMapFunction(const char* qname, DObject* runner, MapRecord* void CallCreateSummaryFunction(const char* qname, DObject* runner, MapRecord* map, SummaryInfo* info, MapRecord* map2) { + if (qname == nullptr || *qname == 0) return; // no level summary defined. auto func = LookupFunction(qname); auto s = func->Proto->ArgumentTypes.Size(); auto at = func->Proto->ArgumentTypes.Data();