From 2b985bda857fabcd07710265cafdd68e9dabfd50 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 28 Jul 2016 14:57:19 +0100 Subject: [PATCH 01/20] Make sure we detect if start >= numlines so we can deal with that properly for some apparent reason the compiler didn't like the while loop condition edit on its own (it complained about inline failures for P_MobjReadyToTrigger for some reason), so I had to add that extra bit above the while loop... and it was happy again, huh --- src/p_spec.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/p_spec.c b/src/p_spec.c index 0bd530279..e11235d81 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1188,7 +1188,10 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start) { start++; - while (lines[start].special != special) + if (start >= (INT32)numlines) + return -1; + + while (start < (INT32)numlines && lines[start].special != special) start++; if (start >= (INT32)numlines) From 4c4f124611a98c66b929403aaaad0eb1a8f63018 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 28 Jul 2016 16:07:26 +0100 Subject: [PATCH 02/20] Detect if -warp's parm is actually a valid map name (MAPxx or plain number), and print an "invalid map name" message if not --- src/d_main.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index 14a8a06e1..b61ec4143 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1060,10 +1060,11 @@ void D_SRB2Main(void) if (M_CheckParm("-warp") && M_IsNextParm()) { const char *word = M_GetNextParm(); - if (fastncmp(word, "MAP", 3)) + char ch; // use this with sscanf to catch non-digits with + if (fastncmp(word, "MAP", 3)) // MAPxx name pstartmap = M_MapNumber(word[3], word[4]); - else - pstartmap = atoi(word); + else if (sscanf(word, "%d%c", &pstartmap, &ch) != 1) // a plain number + I_Error("Cannot warp to map %s (invalid map name)\n", word); // Don't check if lump exists just yet because the wads haven't been loaded! // Just do a basic range check here. if (pstartmap < 1 || pstartmap > NUMMAPS) From 02d3382408adaa81bc68af99c5699747f345014b Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sun, 7 Aug 2016 12:17:31 -0500 Subject: [PATCH 03/20] Leave a note to anyone foolish enough to try to fix this --- src/p_spec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/p_spec.c b/src/p_spec.c index e11235d81..30b08ebb1 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1188,6 +1188,8 @@ INT32 P_FindSpecialLineFromTag(INT16 special, INT16 tag, INT32 start) { start++; + // This redundant check stops the compiler from complaining about function expansion + // elsewhere for some reason and everything is awful if (start >= (INT32)numlines) return -1; From 7795e146fa36959426539001a0176479146103c9 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 12 Aug 2016 15:56:07 +0100 Subject: [PATCH 04/20] Two seperate single-line fixes, both concerning the end of NiGHTS maps. * The NiGHTS drone had a single tic of visibility when you hit the goal, which is evident stepping frame by frame through http://gfycat.com/ComplicatedComposedAoudad (the contents of which may or may not make it into 2.2). * When completing a NiGHTS stage with a non-zero link, the link could flash up in the final few tics before the fade to black. This just checks for player->exiting to make sure it shouldn't be shown. --- src/p_mobj.c | 1 + src/st_stuff.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 62dee0a67..000022b1f 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6931,6 +6931,7 @@ void P_MobjThinker(mobj_t *mobj) { mobj->flags &= ~MF_NOGRAVITY; P_SetMobjState(mobj, S_NIGHTSDRONE1); + mobj->flags2 |= MF2_DONTDRAW; } } else if (mobj->tracer && mobj->tracer->player) diff --git a/src/st_stuff.c b/src/st_stuff.c index aac6b09d2..5b208d33a 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -974,8 +974,8 @@ static void ST_drawNiGHTSHUD(void) if (cv_debug & DBG_NIGHTSBASIC) minlink = 0; - // Cheap hack: don't display when the score is showing - if (stplyr->texttimer && stplyr->textvar == 4) + // Cheap hack: don't display when the score is showing or you're exiting a map + if ((stplyr->exiting) || (stplyr->texttimer && stplyr->textvar == 4)) minlink = INT32_MAX; if (G_IsSpecialStage(gamemap)) From 104fc8ba98db280b3681198a52f693a8fe3d3e1d Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 12 Aug 2016 16:01:03 +0100 Subject: [PATCH 05/20] Partially reverted on Inu's reccomendation. --- src/st_stuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/st_stuff.c b/src/st_stuff.c index 5b208d33a..06639d4f7 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -974,8 +974,8 @@ static void ST_drawNiGHTSHUD(void) if (cv_debug & DBG_NIGHTSBASIC) minlink = 0; - // Cheap hack: don't display when the score is showing or you're exiting a map - if ((stplyr->exiting) || (stplyr->texttimer && stplyr->textvar == 4)) + // Cheap hack: don't display when the score is showing (it popping up for a split second when exiting a map is intentional) + if (stplyr->texttimer && stplyr->textvar == 4) minlink = INT32_MAX; if (G_IsSpecialStage(gamemap)) From da23d93b00cece0ecd413c9090472dbfd6e6cafb Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 13 Aug 2016 10:03:17 -0400 Subject: [PATCH 06/20] Disable netplay for DirectDraw builds --- src/doomdef.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/doomdef.h b/src/doomdef.h index 66e649ee0..fb8ab1ca2 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -60,6 +60,7 @@ #endif #ifdef _WINDOWS +#define NONET #if !defined (HWRENDER) && !defined (NOHW) #define HWRENDER #endif From bdb5db878a7d62545743575c8420d1b2db3e9ce9 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sat, 13 Aug 2016 10:12:14 -0400 Subject: [PATCH 07/20] NONET should also disable UPNP support --- src/i_tcp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/i_tcp.c b/src/i_tcp.c index eca218c80..f6212458b 100644 --- a/src/i_tcp.c +++ b/src/i_tcp.c @@ -56,7 +56,9 @@ //#define NONET #endif -#ifndef NONET +#ifdef NONET +#undef HAVE_MINIUPNPC +#else #ifdef USE_WINSOCK1 #include #elif !defined (SCOUW2) && !defined (SCOUW7) && !defined (__OS2__) From f1a96342607a165963e754b580cab2a405a154a4 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 13 Aug 2016 21:41:18 +0100 Subject: [PATCH 08/20] P_LineOpening now takes a mobj_t argument, instead of relying on tmthing . tmthing can be NULL if called from PTR_SlideTraverse, so we should use slidemo instead This fixes a crash that occurs in yet ANOTHER SUGOI map, involving bouncy walls next to sloped floors/ceilings --- src/p_map.c | 4 ++-- src/p_maputl.c | 42 +++++++++++++++++++++--------------------- src/p_maputl.h | 2 +- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 1f2d903e8..ccf2b1000 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1153,7 +1153,7 @@ static boolean PIT_CheckLine(line_t *ld) } // set openrange, opentop, openbottom - P_LineOpening(ld); + P_LineOpening(ld, tmthing); // adjust floor / ceiling heights if (opentop < tmceilingz) @@ -2581,7 +2581,7 @@ static boolean PTR_SlideTraverse(intercept_t *in) } // set openrange, opentop, openbottom - P_LineOpening(li); + P_LineOpening(li, slidemo); if (openrange < slidemo->height) goto isblocking; // doesn't fit diff --git a/src/p_maputl.c b/src/p_maputl.c index c3a6fa842..df2bf8f5c 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -489,7 +489,7 @@ void P_CameraLineOpening(line_t *linedef) } } -void P_LineOpening(line_t *linedef) +void P_LineOpening(line_t *linedef, mobj_t *mobj) { sector_t *front, *back; @@ -520,8 +520,8 @@ void P_LineOpening(line_t *linedef) { // Set open and high/low values here fixed_t frontheight, backheight; - frontheight = P_GetCeilingZ(tmthing, front, tmx, tmy, linedef); - backheight = P_GetCeilingZ(tmthing, back, tmx, tmy, linedef); + frontheight = P_GetCeilingZ(mobj, front, tmx, tmy, linedef); + backheight = P_GetCeilingZ(mobj, back, tmx, tmy, linedef); if (frontheight < backheight) { @@ -540,8 +540,8 @@ void P_LineOpening(line_t *linedef) #endif } - frontheight = P_GetFloorZ(tmthing, front, tmx, tmy, linedef); - backheight = P_GetFloorZ(tmthing, back, tmx, tmy, linedef); + frontheight = P_GetFloorZ(mobj, front, tmx, tmy, linedef); + backheight = P_GetFloorZ(mobj, back, tmx, tmy, linedef); if (frontheight > backheight) { @@ -561,9 +561,9 @@ void P_LineOpening(line_t *linedef) } } - if (tmthing) + if (mobj) { - fixed_t thingtop = tmthing->z + tmthing->height; + fixed_t thingtop = mobj->z + mobj->height; // Check for collision with front side's midtexture if Effect 4 is set if (linedef->flags & ML_EFFECT4) { @@ -598,7 +598,7 @@ void P_LineOpening(line_t *linedef) texmid = texbottom+(textop-texbottom)/2; - delta1 = abs(tmthing->z - texmid); + delta1 = abs(mobj->z - texmid); delta2 = abs(thingtop - texmid); if (delta1 > delta2) { // Below @@ -636,16 +636,16 @@ void P_LineOpening(line_t *linedef) if (!(rover->flags & FF_EXISTS)) continue; - if (tmthing->player && (P_CheckSolidLava(tmthing, rover) || P_CanRunOnWater(tmthing->player, rover))) + if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) ; - else if (!((rover->flags & FF_BLOCKPLAYER && tmthing->player) - || (rover->flags & FF_BLOCKOTHERS && !tmthing->player))) + else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) + || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) continue; - topheight = P_GetFOFTopZ(tmthing, front, rover, tmx, tmy, linedef); - bottomheight = P_GetFOFBottomZ(tmthing, front, rover, tmx, tmy, linedef); + topheight = P_GetFOFTopZ(mobj, front, rover, tmx, tmy, linedef); + bottomheight = P_GetFOFBottomZ(mobj, front, rover, tmx, tmy, linedef); - delta1 = abs(tmthing->z - (bottomheight + ((topheight - bottomheight)/2))); + delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF @@ -680,16 +680,16 @@ void P_LineOpening(line_t *linedef) if (!(rover->flags & FF_EXISTS)) continue; - if (tmthing->player && (P_CheckSolidLava(tmthing, rover) || P_CanRunOnWater(tmthing->player, rover))) + if (mobj->player && (P_CheckSolidLava(mobj, rover) || P_CanRunOnWater(mobj->player, rover))) ; - else if (!((rover->flags & FF_BLOCKPLAYER && tmthing->player) - || (rover->flags & FF_BLOCKOTHERS && !tmthing->player))) + else if (!((rover->flags & FF_BLOCKPLAYER && mobj->player) + || (rover->flags & FF_BLOCKOTHERS && !mobj->player))) continue; - topheight = P_GetFOFTopZ(tmthing, back, rover, tmx, tmy, linedef); - bottomheight = P_GetFOFBottomZ(tmthing, back, rover, tmx, tmy, linedef); + topheight = P_GetFOFTopZ(mobj, back, rover, tmx, tmy, linedef); + bottomheight = P_GetFOFBottomZ(mobj, back, rover, tmx, tmy, linedef); - delta1 = abs(tmthing->z - (bottomheight + ((topheight - bottomheight)/2))); + delta1 = abs(mobj->z - (bottomheight + ((topheight - bottomheight)/2))); delta2 = abs(thingtop - (bottomheight + ((topheight - bottomheight)/2))); if (delta1 >= delta2 && !(rover->flags & FF_PLATFORM)) // thing is below FOF @@ -723,7 +723,7 @@ void P_LineOpening(line_t *linedef) { const sector_t *polysec = linedef->backsector; - delta1 = abs(tmthing->z - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2))); + delta1 = abs(mobj->z - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2))); delta2 = abs(thingtop - (polysec->floorheight + ((polysec->ceilingheight - polysec->floorheight)/2))); if (polysec->floorheight < lowestceiling && delta1 >= delta2) { lowestceiling = polysec->floorheight; diff --git a/src/p_maputl.h b/src/p_maputl.h index c160bfa28..3d74e927b 100644 --- a/src/p_maputl.h +++ b/src/p_maputl.h @@ -59,7 +59,7 @@ extern fixed_t opentop, openbottom, openrange, lowfloor, highceiling; extern pslope_t *opentopslope, *openbottomslope; #endif -void P_LineOpening(line_t *plinedef); +void P_LineOpening(line_t *plinedef, mobj_t *mobj); boolean P_BlockLinesIterator(INT32 x, INT32 y, boolean(*func)(line_t *)); boolean P_BlockThingsIterator(INT32 x, INT32 y, boolean(*func)(mobj_t *)); From 758c77fe53a90a6013801f754bb083c851c99d8c Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sat, 13 Aug 2016 17:43:22 -0500 Subject: [PATCH 09/20] Fixed non-players having fucked slope stepup/down --- src/p_map.c | 8 ++++++-- src/p_mobj.c | 6 ++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 1f2d903e8..245736056 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1970,8 +1970,12 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) } // Ramp test - if (thing->player && maxstep > 0 - && !(P_PlayerTouchingSectorSpecial(thing->player, 1, 14) || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14)) + if (maxstep > 0 && !( + thing->player && ( + P_PlayerTouchingSectorSpecial(thing->player, 1, 14) + || GETSECSPECIAL(R_PointInSubsector(x, y)->sector->special, 1) == 14) + ) + ) { // If the floor difference is MAXSTEPMOVE or less, and the sector isn't Section1:14, ALWAYS // step down! Formerly required a Section1:13 sector for the full MAXSTEPMOVE, but no more. diff --git a/src/p_mobj.c b/src/p_mobj.c index 62dee0a67..77dfd1923 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1650,8 +1650,6 @@ void P_XYMovement(mobj_t *mo) I_Assert(mo != NULL); I_Assert(!P_MobjWasRemoved(mo)); - moved = true; - // if it's stopped if (!mo->momx && !mo->momy) { @@ -1708,9 +1706,9 @@ void P_XYMovement(mobj_t *mo) if (!P_TryMove(mo, mo->x + xmove, mo->y + ymove, true) && !(mo->eflags & MFE_SPRUNG)) { // blocked move + moved = false; if (player) { - moved = false; if (player->bot) B_MoveBlocked(player); } @@ -1815,7 +1813,7 @@ void P_XYMovement(mobj_t *mo) else mo->momx = mo->momy = 0; } - else if (player) + else moved = true; if (P_MobjWasRemoved(mo)) // MF_SPECIAL touched a player! O_o;; From 55b8ef9f641947d68e6ce40bd7b03f775ed984fd Mon Sep 17 00:00:00 2001 From: RedEnchilada Date: Sun, 14 Aug 2016 00:03:00 -0500 Subject: [PATCH 10/20] More stepping upward fixing ugh --- src/p_mobj.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/p_mobj.c b/src/p_mobj.c index 77dfd1923..1eb503238 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2373,6 +2373,12 @@ static boolean P_ZMovement(mobj_t *mo) mo->z = mo->floorz; #ifdef ESLOPE + if (mo->standingslope) // You're still on the ground; why are we here? + { + mo->momz = 0; + return; + } + P_CheckPosition(mo, mo->x, mo->y); // Sets mo->standingslope correctly if (((mo->eflags & MFE_VERTICALFLIP) ? tmceilingslope : tmfloorslope) && (mo->type != MT_STEAM)) { From 0264fd24ae541adaa8d261e6ebe4690470c84d00 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias Date: Sun, 14 Aug 2016 10:43:44 -0400 Subject: [PATCH 11/20] @MonsterIestyn: Should probably be returning true then --- src/p_mobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index 1eb503238..e1a1820af 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -2376,7 +2376,7 @@ static boolean P_ZMovement(mobj_t *mo) if (mo->standingslope) // You're still on the ground; why are we here? { mo->momz = 0; - return; + return true; } P_CheckPosition(mo, mo->x, mo->y); // Sets mo->standingslope correctly From 1530183ddf1323748938cd41919aa4816b1f68a7 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sun, 14 Aug 2016 16:56:41 +0100 Subject: [PATCH 12/20] Fix multiple solid midtexture-related issues: * Effect 3 (Peg Midtexture) is now accounted for properly, flipping the collision box position to match the actual rendered position of the midtexture * Fixed incorrect application of y-offsets for non-lower unpegged midtextures collision boxes; +ve always goes up, -ve always goes down! * Effect 4 now doesn't make midtextures solid for polyobjects at all - this "conflicted" with First Line having both Effect 4 (visible planes) and Effect 3 (intangible) simultaneously, where we kind of expect the first line's wall to not be made solid. This may be less of a problem in future SRB2 versions, but for now solid midtextures for polyobjects are disabled. --- src/p_maputl.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index df2bf8f5c..373679122 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -566,7 +566,9 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) fixed_t thingtop = mobj->z + mobj->height; // Check for collision with front side's midtexture if Effect 4 is set - if (linedef->flags & ML_EFFECT4) { + if (linedef->flags & ML_EFFECT4 + && !linedef->polyobj // don't do anything for polyobjects! ...for now + ) { side_t *side = &sides[linedef->sidenum[0]]; fixed_t textop, texbottom, texheight; fixed_t texmid, delta1, delta2; @@ -575,23 +577,25 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) texheight = textures[texturetranslation[side->midtexture]]->height << FRACBITS; // Set texbottom and textop to the Z coordinates of the texture's boundaries -#ifdef POLYOBJECTS +#if 0 // #ifdef POLYOBJECTS + // don't remove this code unless solid midtextures + // on non-solid polyobjects should NEVER happen in the future if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) { - if (linedef->flags & ML_DONTPEGBOTTOM) { + if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) { texbottom = back->floorheight + side->rowoffset; textop = texbottom + texheight*(side->repeatcnt+1); } else { - textop = back->ceilingheight - side->rowoffset; + textop = back->ceilingheight + side->rowoffset; texbottom = textop - texheight*(side->repeatcnt+1); } } else #endif { - if (linedef->flags & ML_DONTPEGBOTTOM) { + if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) { texbottom = openbottom + side->rowoffset; textop = texbottom + texheight*(side->repeatcnt+1); } else { - textop = opentop - side->rowoffset; + textop = opentop + side->rowoffset; texbottom = textop - texheight*(side->repeatcnt+1); } } From 3d9fe7c899d7c63c91f8605fe6e503b68201540c Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 19 Aug 2016 00:06:12 +0100 Subject: [PATCH 13/20] The ability to disable weapon rings, as heavily requested by Lat and Speedwagon for their high effort character .wads and selfishly also desired to make thokker less hacky. --- src/lua_hud.h | 3 +++ src/lua_hudlib.c | 3 +++ src/st_stuff.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+) diff --git a/src/lua_hud.h b/src/lua_hud.h index 799ce2fbf..80e8ae03e 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -18,6 +18,9 @@ enum hud { hud_time, hud_rings, hud_lives, + // Match + hud_weaponrings, + hud_powerstones, // NiGHTS mode hud_nightslink, hud_nightsdrill, diff --git a/src/lua_hudlib.c b/src/lua_hudlib.c index 31549afa7..7aadd9c0e 100644 --- a/src/lua_hudlib.c +++ b/src/lua_hudlib.c @@ -44,6 +44,9 @@ static const char *const hud_disable_options[] = { "rings", "lives", + "weaponrings", + "powerstones", + "nightslink", "nightsdrill", "nightsrings", diff --git a/src/st_stuff.c b/src/st_stuff.c index aac6b09d2..ca315ce27 100644 --- a/src/st_stuff.c +++ b/src/st_stuff.c @@ -1385,6 +1385,10 @@ static void ST_drawMatchHUD(void) if (G_TagGametype() && !(stplyr->pflags & PF_TAGIT)) return; +#ifdef HAVE_BLUA + if (LUA_HudEnabled(hud_weaponrings)) { +#endif + if (stplyr->powers[pw_infinityring]) ST_drawWeaponRing(pw_infinityring, 0, 0, offset, infinityring); else if (stplyr->health > 1) @@ -1408,6 +1412,12 @@ static void ST_drawMatchHUD(void) offset += 20; ST_drawWeaponRing(pw_railring, RW_RAIL, WEP_RAIL, offset, railring); +#ifdef HAVE_BLUA + } + + if (LUA_HudEnabled(hud_powerstones)) { +#endif + // Power Stones collected offset = 136; // Used for Y now @@ -1439,6 +1449,10 @@ static void ST_drawMatchHUD(void) if (stplyr->powers[pw_emeralds] & EMERALD7) V_DrawScaledPatch(28, STRINGY(offset), V_SNAPTOLEFT, tinyemeraldpics[6]); + +#ifdef HAVE_BLUA + } +#endif } static inline void ST_drawRaceHUD(void) From 3db3433a513b84ddd26774490e4f51f6c8758c09 Mon Sep 17 00:00:00 2001 From: toasterbabe Date: Fri, 19 Aug 2016 00:07:32 +0100 Subject: [PATCH 14/20] More consistent comment. --- src/lua_hud.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lua_hud.h b/src/lua_hud.h index 80e8ae03e..ba0a1d894 100644 --- a/src/lua_hud.h +++ b/src/lua_hud.h @@ -18,7 +18,7 @@ enum hud { hud_time, hud_rings, hud_lives, - // Match + // Match / CTF / Tag / Ringslinger hud_weaponrings, hud_powerstones, // NiGHTS mode From 44df9358dd37bec003674e44141441165dba1ee1 Mon Sep 17 00:00:00 2001 From: Inuyasha Date: Fri, 19 Aug 2016 22:18:43 -0700 Subject: [PATCH 15/20] If the game becomes modified during a record attack run, end it RA menu can be opened if the game is modified, but Start can't be selected. (Obvious reason: so scripts to display info can be used easier) Fixed the stupid background for messages in the Record Attack menu, it was bugging me --- src/g_game.c | 4 ++++ src/m_menu.c | 13 +++++++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/src/g_game.c b/src/g_game.c index 8931f8b6b..f891b0105 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -711,6 +711,10 @@ void G_SetGameModified(boolean silent) if (!silent) CONS_Alert(CONS_NOTICE, M_GetText("Game must be restarted to record statistics.\n")); + + // If in record attack recording, cancel it. + if (modeattacking) + M_EndModeAttackRun(); } /** Builds an original game map name from a map number. diff --git a/src/m_menu.c b/src/m_menu.c index 6c1294444..78c381273 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -705,7 +705,7 @@ static menuitem_t SP_TimeAttackMenu[] = {IT_DISABLED, NULL, "Guest Option...", &SP_GuestReplayDef, 100}, {IT_DISABLED, NULL, "Replay...", &SP_ReplayDef, 110}, {IT_DISABLED, NULL, "Ghosts...", &SP_GhostDef, 120}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_ChooseTimeAttack, 130}, + {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseTimeAttack, 130}, }; enum @@ -797,7 +797,7 @@ static menuitem_t SP_NightsAttackMenu[] = {IT_DISABLED, NULL, "Guest Option...", &SP_NightsGuestReplayDef, 108}, {IT_DISABLED, NULL, "Replay...", &SP_NightsReplayDef, 118}, {IT_DISABLED, NULL, "Ghosts...", &SP_NightsGhostDef, 128}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_ChooseNightsAttack, 138}, + {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseNightsAttack, 138}, }; enum @@ -3702,6 +3702,11 @@ static void M_DrawMessageMenu(void) mlines = currentMenu->lastOn>>8; max = (INT16)((UINT8)(currentMenu->lastOn & 0xFF)*8); + + // hack: draw RA background in RA menus + if (gamestate == GS_TIMEATTACK) + V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); + M_DrawTextBox(currentMenu->x, y - 8, (max+7)>>3, mlines); while (*(msg+start)) @@ -4310,9 +4315,9 @@ static void M_SinglePlayerMenu(INT32 choice) { (void)choice; SP_MainMenu[sprecordattack].status = - (M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING|IT_CALL_NOTMODIFIED : IT_SECRET; + (M_SecretUnlocked(SECRET_RECORDATTACK)) ? IT_CALL|IT_STRING : IT_SECRET; SP_MainMenu[spnightsmode].status = - (M_SecretUnlocked(SECRET_NIGHTSMODE)) ? IT_CALL|IT_STRING|IT_CALL_NOTMODIFIED : IT_SECRET; + (M_SecretUnlocked(SECRET_NIGHTSMODE)) ? IT_CALL|IT_STRING : IT_SECRET; M_SetupNextMenu(&SP_MainDef); } From ab3f677e664fc732e265c4a0d87f4ab05d241d13 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 25 Aug 2016 17:58:54 +0100 Subject: [PATCH 16/20] F_EndCutScene now sets cutsceneover to true BEFORE running Y_EndGame and the like, not AFTER --- src/f_finale.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/f_finale.c b/src/f_finale.c index 784d82047..2245a534f 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -1725,6 +1725,7 @@ static void F_AdvanceToNextScene(void) void F_EndCutScene(void) { + cutsceneover = true; // do this first, just in case Y_EndGame or something wants to turn it back false later if (runningprecutscene) { if (server) @@ -1741,7 +1742,6 @@ void F_EndCutScene(void) else Y_EndGame(); } - cutsceneover = true; } void F_StartCustomCutscene(INT32 cutscenenum, boolean precutscene, boolean resetplayer) From 2a6a21a4a28bfcce0c16fa83090386ac4ecbd467 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Sat, 27 Aug 2016 17:14:21 +0100 Subject: [PATCH 17/20] Solid midtextures now account for "infinite" repeats --- src/p_maputl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/p_maputl.c b/src/p_maputl.c index 373679122..fea8530a1 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -581,7 +581,10 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) // don't remove this code unless solid midtextures // on non-solid polyobjects should NEVER happen in the future if (linedef->polyobj && (linedef->polyobj->flags & POF_TESTHEIGHT)) { - if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) { + if (linedef->flags & ML_EFFECT5 && !side->repeatcnt) { // "infinite" repeat + texbottom = back->floorheight + side->rowoffset; + textop = back->ceilingheight + side->rowoffset; + } else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) { texbottom = back->floorheight + side->rowoffset; textop = texbottom + texheight*(side->repeatcnt+1); } else { @@ -591,7 +594,10 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) } else #endif { - if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) { + if (linedef->flags & ML_EFFECT5 && !side->repeatcnt) { // "infinite" repeat + texbottom = openbottom + side->rowoffset; + textop = opentop + side->rowoffset; + } else if (!!(linedef->flags & ML_DONTPEGBOTTOM) ^ !!(linedef->flags & ML_EFFECT3)) { texbottom = openbottom + side->rowoffset; textop = texbottom + texheight*(side->repeatcnt+1); } else { From eae47c9808335c7177a85769a10f1ddaf58e59b5 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Thu, 1 Sep 2016 21:21:20 +0100 Subject: [PATCH 18/20] Fix Knuckles in 2D mode attempting to latch onto air when gliding into a slope. Now he just attempts to latch onto the slope directly (which I'll fix another time, if I can figure out how) (fix for SUGOI's Retro Hill Zone) --- src/p_user.c | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index f390650f4..4d8b6af1a 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -6976,6 +6976,7 @@ static void P_MovePlayer(player_t *player) msecnode_t *node; // only place it's being used in P_MovePlayer now fixed_t oldx; fixed_t oldy; + fixed_t floorz, ceilingz; oldx = player->mo->x; oldy = player->mo->y; @@ -6993,31 +6994,34 @@ static void P_MovePlayer(player_t *player) if (node->m_sector->ffloors) { ffloor_t *rover; + fixed_t topheight, bottomheight; for (rover = node->m_sector->ffloors; rover; rover = rover->next) { - if (!(rover->flags & FF_EXISTS)) continue; + if (!(rover->flags & FF_EXISTS) || !(rover->flags & FF_BLOCKPLAYER)) + continue; - if ((rover->flags & FF_BLOCKPLAYER)) + topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); + bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); + if (topheight > player->mo->z && bottomheight < player->mo->z) { - if (*rover->topheight > player->mo->z && *rover->bottomheight < player->mo->z) - { - P_ResetPlayer(player); - S_StartSound(player->mo, sfx_s3k4a); - player->climbing = 5; - player->mo->momx = player->mo->momy = player->mo->momz = 0; - break; - } + P_ResetPlayer(player); + S_StartSound(player->mo, sfx_s3k4a); + player->climbing = 5; + player->mo->momx = player->mo->momy = player->mo->momz = 0; + break; } } } - if (player->mo->z+player->mo->height > node->m_sector->ceilingheight + floorz = P_GetFloorZ(player->mo, node->m_sector, player->mo->x, player->mo->y, NULL); + ceilingz = P_GetCeilingZ(player->mo, node->m_sector, player->mo->x, player->mo->y, NULL); + + if (player->mo->z+player->mo->height > ceilingz && node->m_sector->ceilingpic == skyflatnum) continue; - if (node->m_sector->floorheight > player->mo->z - || node->m_sector->ceilingheight < player->mo->z) + if (floorz > player->mo->z || ceilingz < player->mo->z) { P_ResetPlayer(player); S_StartSound(player->mo, sfx_s3k4a); From 8f02c50c1068ee6440b0f8e180f2805f9f778062 Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 2 Sep 2016 21:41:45 +0100 Subject: [PATCH 19/20] Fix players and pushables not accounting for slopes on bustable FOFs --- src/p_mobj.c | 19 +++++++++++-------- src/p_user.c | 22 +++++++++++++--------- 2 files changed, 24 insertions(+), 17 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index e1a1820af..9f4f2429c 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -1553,6 +1553,7 @@ static void P_PushableCheckBustables(mobj_t *mo) if (node->m_sector->ffloors) { ffloor_t *rover; + fixed_t topheight, bottomheight; for (rover = node->m_sector->ffloors; rover; rover = rover->next) { @@ -1565,37 +1566,39 @@ static void P_PushableCheckBustables(mobj_t *mo) if (!rover->master->frontsector->crumblestate) { + topheight = P_GetFOFTopZ(mo, node->m_sector, rover, mo->x, mo->y, NULL); + bottomheight = P_GetFOFBottomZ(mo, node->m_sector, rover, mo->x, mo->y, NULL); // Height checks if (rover->flags & FF_SHATTERBOTTOM) { - if (mo->z+mo->momz + mo->height < *rover->bottomheight) + if (mo->z+mo->momz + mo->height < bottomheight) continue; - if (mo->z+mo->height > *rover->bottomheight) + if (mo->z+mo->height > bottomheight) continue; } else if (rover->flags & FF_SPINBUST) { - if (mo->z+mo->momz > *rover->topheight) + if (mo->z+mo->momz > topheight) continue; - if (mo->z+mo->height < *rover->bottomheight) + if (mo->z+mo->height < bottomheight) continue; } else if (rover->flags & FF_SHATTER) { - if (mo->z+mo->momz > *rover->topheight) + if (mo->z+mo->momz > topheight) continue; - if (mo->z+mo->momz + mo->height < *rover->bottomheight) + if (mo->z+mo->momz + mo->height < bottomheight) continue; } else { - if (mo->z >= *rover->topheight) + if (mo->z >= topheight) continue; - if (mo->z+mo->height < *rover->bottomheight) + if (mo->z+mo->height < bottomheight) continue; } diff --git a/src/p_user.c b/src/p_user.c index 4d8b6af1a..3867137ad 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -1692,6 +1692,7 @@ static void P_CheckBustableBlocks(player_t *player) if (node->m_sector->ffloors) { ffloor_t *rover; + fixed_t topheight, bottomheight; for (rover = node->m_sector->ffloors; rover; rover = rover->next) { @@ -1717,42 +1718,45 @@ static void P_CheckBustableBlocks(player_t *player) if (!(rover->flags & FF_SHATTER) && (rover->flags & FF_ONLYKNUX) && !(player->charability == CA_GLIDEANDCLIMB)) continue; + topheight = P_GetFOFTopZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); + bottomheight = P_GetFOFBottomZ(player->mo, node->m_sector, rover, player->mo->x, player->mo->y, NULL); + // Height checks if (rover->flags & FF_SHATTERBOTTOM) { - if (player->mo->z+player->mo->momz + player->mo->height < *rover->bottomheight) + if (player->mo->z+player->mo->momz + player->mo->height < bottomheight) continue; - if (player->mo->z+player->mo->height > *rover->bottomheight) + if (player->mo->z+player->mo->height > bottomheight) continue; } else if (rover->flags & FF_SPINBUST) { - if (player->mo->z+player->mo->momz > *rover->topheight) + if (player->mo->z+player->mo->momz > topheight) continue; - if (player->mo->z + player->mo->height < *rover->bottomheight) + if (player->mo->z + player->mo->height < bottomheight) continue; } else if (rover->flags & FF_SHATTER) { - if (player->mo->z + player->mo->momz > *rover->topheight) + if (player->mo->z + player->mo->momz > topheight) continue; - if (player->mo->z+player->mo->momz + player->mo->height < *rover->bottomheight) + if (player->mo->z+player->mo->momz + player->mo->height < bottomheight) continue; } else { - if (player->mo->z >= *rover->topheight) + if (player->mo->z >= topheight) continue; - if (player->mo->z + player->mo->height < *rover->bottomheight) + if (player->mo->z + player->mo->height < bottomheight) continue; } // Impede the player's fall a bit - if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= *rover->topheight) + if (((rover->flags & FF_SPINBUST) || (rover->flags & FF_SHATTER)) && player->mo->z >= topheight) player->mo->momz >>= 1; else if (rover->flags & FF_SHATTER) { From a860c068d8852c531f1ae23a9fd8c53c2cdeb98b Mon Sep 17 00:00:00 2001 From: Monster Iestyn Date: Fri, 2 Sep 2016 22:53:55 +0100 Subject: [PATCH 20/20] BONUS UNRELATED FIX: Fix FF_SHATTERBOTTOM FOFs acting like THZ goop when stood on --- src/p_map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/p_map.c b/src/p_map.c index d8c48fa4f..c4616db48 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -1271,7 +1271,7 @@ boolean P_CheckPosition(mobj_t *thing, fixed_t x, fixed_t y) topheight = P_GetFOFTopZ(thing, newsubsec->sector, rover, x, y, NULL); bottomheight = P_GetFOFBottomZ(thing, newsubsec->sector, rover, x, y, NULL); - if (rover->flags & FF_GOOWATER && !(thing->flags & MF_NOGRAVITY)) + if ((rover->flags & (FF_SWIMMABLE|FF_GOOWATER)) == (FF_SWIMMABLE|FF_GOOWATER) && !(thing->flags & MF_NOGRAVITY)) { // If you're inside goowater and slowing down fixed_t sinklevel = FixedMul(thing->info->height/6, thing->scale);