From 57c7e9303e77e0aece2516e48493438087d7f69b Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 22 Sep 2018 22:22:44 -0400 Subject: [PATCH 01/44] Obvious first commit: enable the NOCLIPCAM define again --- src/doomdef.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/doomdef.h b/src/doomdef.h index b5519f6fd..31eb1877f 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -546,6 +546,6 @@ extern const char *compdate, *comptime, *comprevision, *compbranch; /// SRB2Kart: Camera always has noclip. /// \note Kind of problematic. If we decide to keep this on, we'll need serious map changes. -//#define NOCLIPCAM +#define NOCLIPCAM #endif // __DOOMDEF__ From 6f10f15627a1a82a63028255db8466865d9c8e68 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 22 Sep 2018 22:46:06 -0400 Subject: [PATCH 02/44] Attempt to not let the camera into thok barriers Doesn't really work right now; it'll still go into thok barriers and get caught up at its floor height --- src/p_map.c | 19 ++++++++++++++----- src/p_mobj.c | 2 ++ 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 41d61cb05..e9d38272f 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2181,6 +2181,12 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) mapcampointer = thiscam; +#ifdef NOCLIPCAM + if (newsubsec->sector->floorheight >= newsubsec->sector->ceilingheight + || newsubsec->sector->ceilingheight <= newsubsec->sector->floorheight) + return false; +#endif + if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12) { // Camera noclip on entire sector. tmfloorz = tmdropoffz = thiscam->z; @@ -2378,12 +2384,15 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) fixed_t tryx = thiscam->x; fixed_t tryy = thiscam->y; -#ifndef NOCLIPCAM +#ifdef NOCLIPCAM + if (!(s->sector->floorheight >= s->sector->ceilingheight + || s->sector->ceilingheight <= s->sector->floorheight)) +#else if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) - || (leveltime < introtime)) + || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) + || (leveltime < introtime)) #endif { // Noclipping player camera noclips too!! floatok = true; diff --git a/src/p_mobj.c b/src/p_mobj.c index d39e38766..233b307f6 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3701,6 +3701,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled { if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) { // Never fails for 2D mode. +#ifndef NOCLIPCAM mobj_t dummy; dummy.thinker.function.acp1 = (actionf_p1)P_MobjThinker; dummy.subsector = thiscam->subsector; @@ -3711,6 +3712,7 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead. P_ResetCamera(player, thiscam); else +#endif P_SlideCameraMove(thiscam); if (resetcalled) // Okay this means the camera is fully reset. return true; From 9c6a1aaac0574be3bf71fa17307d79e9d61c8b73 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 25 Sep 2018 22:33:22 +0100 Subject: [PATCH 03/44] Manual has more pages and less terrible large-size support. --- src/m_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/m_menu.c b/src/m_menu.c index 5d0448ce0..071fdc421 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -663,7 +663,8 @@ static menuitem_t MISC_HelpMenu[] = {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL09", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL10", M_HandleImageDef, 1}, {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL11", M_HandleImageDef, 1}, - {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 0}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL12", M_HandleImageDef, 1}, + {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL99", M_HandleImageDef, 0}, }; // -------------------------------- @@ -4264,7 +4265,7 @@ static void M_DrawImageDef(void) else { patch_t *patch = W_CachePatchName(currentMenu->menuitems[itemOn].text,PU_CACHE); - if (patch->width <= BASEVIDWIDTH) + if (patch->height <= BASEVIDHEIGHT) V_DrawScaledPatch(0,0,0,patch); else V_DrawSmallScaledPatch(0,0,0,patch); From 6835b17f699809f102b8b43cc791bbc04581f4d6 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 25 Sep 2018 22:37:04 +0100 Subject: [PATCH 04/44] Just realised the inputwheel jittering in Sryder's videos was my fault, so fix this even better --- src/k_kart.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index ed91616b3..f4b9e93a7 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7096,10 +7096,7 @@ static void K_drawInput(void) } if (pn < 0) - { splitflags |= V_FLIP; // right turn - x--; - } target = abs(pn); if (target > 4) From 880037c2e3b544e92b2c699804bb1dc772515114 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 18:11:43 +0100 Subject: [PATCH 05/44] Revamp flat alignment to be consistent across all renderer functions except for the software slope renderer, which me and fickle tried our best at but couldn't get to work. (This is a backport of 2.2 code that slightly postdates the improved flat alignment Kart's had for a while.) This fixes #11. --- src/hardware/hw_main.c | 18 ++++---- src/p_spec.c | 6 +-- src/r_bsp.c | 44 +++----------------- src/r_plane.c | 93 ++++++++++++++++++++++++++++++++++-------- 4 files changed, 94 insertions(+), 67 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 6a664d39b..543627627 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -643,13 +643,13 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { scrollx = FIXED_TO_FLOAT(FOFsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->floor_yoffs)/fflatsize; - angle = FOFsector->floorpic_angle>>ANGLETOFINESHIFT; + angle = FOFsector->floorpic_angle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(FOFsector->ceiling_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(FOFsector->ceiling_yoffs)/fflatsize; - angle = FOFsector->ceilingpic_angle>>ANGLETOFINESHIFT; + angle = FOFsector->ceilingpic_angle; } } else if (gr_frontsector) @@ -658,24 +658,26 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { scrollx = FIXED_TO_FLOAT(gr_frontsector->floor_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->floor_yoffs)/fflatsize; - angle = gr_frontsector->floorpic_angle>>ANGLETOFINESHIFT; + angle = gr_frontsector->floorpic_angle; } else // it's a ceiling { scrollx = FIXED_TO_FLOAT(gr_frontsector->ceiling_xoffs)/fflatsize; scrolly = FIXED_TO_FLOAT(gr_frontsector->ceiling_yoffs)/fflatsize; - angle = gr_frontsector->ceilingpic_angle>>ANGLETOFINESHIFT; + angle = gr_frontsector->ceilingpic_angle; } } if (angle) // Only needs to be done if there's an altered angle { + angle = InvAngle(angle)>>ANGLETOFINESHIFT; + // This needs to be done so that it scrolls in a different direction after rotation like software - tempxsow = FLOAT_TO_FIXED(scrollx); + /*tempxsow = FLOAT_TO_FIXED(scrollx); tempytow = FLOAT_TO_FIXED(scrolly); scrollx = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); - scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); + scrolly = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle))));*/ // This needs to be done so everything aligns after rotation // It would be done so that rotation is done, THEN the translation, but I couldn't get it to rotate AND scroll like software does @@ -689,7 +691,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is { // Hurdler: add scrolling texture on floor/ceiling v3d->sow = (float)((pv->x / fflatsize) - flatxref + scrollx); - v3d->tow = (float)(flatyref - (pv->y / fflatsize) + scrolly); + v3d->tow = (float)(-(pv->y / fflatsize) + flatyref + scrolly); //v3d->sow = (float)(pv->x / fflatsize); //v3d->tow = (float)(pv->y / fflatsize); @@ -700,7 +702,7 @@ static void HWR_RenderPlane(sector_t *sector, extrasubsector_t *xsub, boolean is tempxsow = FLOAT_TO_FIXED(v3d->sow); tempytow = FLOAT_TO_FIXED(v3d->tow); v3d->sow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINECOSINE(angle)) - FixedMul(tempytow, FINESINE(angle)))); - v3d->tow = (FIXED_TO_FLOAT(-FixedMul(tempxsow, FINESINE(angle)) - FixedMul(tempytow, FINECOSINE(angle)))); + v3d->tow = (FIXED_TO_FLOAT(FixedMul(tempxsow, FINESINE(angle)) + FixedMul(tempytow, FINECOSINE(angle)))); } //v3d->sow = (float)(v3d->sow - flatxref + scrollx); diff --git a/src/p_spec.c b/src/p_spec.c index 17cd1f886..86ac8f005 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -5821,10 +5821,8 @@ void P_SpawnSpecials(INT32 fromnetsave) } else // Otherwise, set calculated offsets such that line's v1 is the apparent origin { - fixed_t cosinecomponent = FINECOSINE(flatangle>>ANGLETOFINESHIFT); - fixed_t sinecomponent = FINESINE(flatangle>>ANGLETOFINESHIFT); - xoffs = (-FixedMul(lines[i].v1->x, cosinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, sinecomponent) % MAXFLATSIZE); // No danger of overflow thanks to the strategically placed modulo operations. - yoffs = (FixedMul(lines[i].v1->x, sinecomponent) % MAXFLATSIZE) + (FixedMul(lines[i].v1->y, cosinecomponent) % MAXFLATSIZE); // Ditto. + xoffs = -lines[i].v1->x; + yoffs = lines[i].v1->y; } for (s = -1; (s = P_FindSectorFromLineTag(lines + i, s)) >= 0 ;) diff --git a/src/r_bsp.c b/src/r_bsp.c index 34b082caf..82a7624b5 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -1126,30 +1126,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber) && polysec->floorheight >= floorcenterz && (viewz < polysec->floorheight)) { - fixed_t xoff, yoff; - xoff = polysec->floor_xoffs; - yoff = polysec->floor_yoffs; - - if (po->angle != 0) { - angle_t fineshift = po->angle >> ANGLETOFINESHIFT; - - xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y); - yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y); - } else { - xoff -= po->centerPt.x; - yoff += po->centerPt.y; - } - light = R_GetPlaneLight(frontsector, polysec->floorheight, viewz < polysec->floorheight); light = 0; ffloor[numffloors].plane = R_FindPlane(polysec->floorheight, polysec->floorpic, - polysec->lightlevel, xoff, yoff, + polysec->lightlevel, polysec->floor_xoffs, polysec->floor_yoffs, polysec->floorpic_angle-po->angle, - NULL, - NULL -#ifdef POLYOBJECTS_PLANES - , po -#endif + NULL, NULL, po #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif @@ -1174,28 +1156,12 @@ static void R_Subsector(size_t num, UINT8 viewnumber) && polysec->ceilingheight <= ceilingcenterz && (viewz > polysec->ceilingheight)) { - fixed_t xoff, yoff; - xoff = polysec->ceiling_xoffs; - yoff = polysec->ceiling_yoffs; - - if (po->angle != 0) { - angle_t fineshift = po->angle >> ANGLETOFINESHIFT; - - xoff -= FixedMul(FINECOSINE(fineshift), po->centerPt.x)+FixedMul(FINESINE(fineshift), po->centerPt.y); - yoff -= FixedMul(FINESINE(fineshift), po->centerPt.x)-FixedMul(FINECOSINE(fineshift), po->centerPt.y); - } else { - xoff -= po->centerPt.x; - yoff += po->centerPt.y; - } - light = R_GetPlaneLight(frontsector, polysec->ceilingheight, viewz < polysec->ceilingheight); light = 0; ffloor[numffloors].plane = R_FindPlane(polysec->ceilingheight, polysec->ceilingpic, - polysec->lightlevel, xoff, yoff, polysec->ceilingpic_angle-po->angle, - NULL, NULL -#ifdef POLYOBJECTS_PLANES - , po -#endif + polysec->lightlevel, polysec->ceiling_xoffs, polysec->ceiling_yoffs, + polysec->ceilingpic_angle-po->angle, + NULL, NULL, po #ifdef ESLOPE , NULL // will ffloors be slopable eventually? #endif diff --git a/src/r_plane.c b/src/r_plane.c index 0f0e2f7af..c884a9c32 100644 --- a/src/r_plane.c +++ b/src/r_plane.c @@ -450,19 +450,37 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, #ifdef ESLOPE if (slope); else // Don't mess with this right now if a slope is involved #endif - if (plangle != 0) - { - // Add the view offset, rotated by the plane angle. - angle_t angle = plangle>>ANGLETOFINESHIFT; - xoff += FixedMul(viewx,FINECOSINE(angle))-FixedMul(viewy,FINESINE(angle)); - yoff += -FixedMul(viewx,FINESINE(angle))-FixedMul(viewy,FINECOSINE(angle)); - } - else { xoff += viewx; yoff -= viewy; + if (plangle != 0) + { + // Add the view offset, rotated by the plane angle. + fixed_t cosinecomponent = FINECOSINE(plangle>>ANGLETOFINESHIFT); + fixed_t sinecomponent = FINESINE(plangle>>ANGLETOFINESHIFT); + fixed_t oldxoff = xoff; + xoff = FixedMul(xoff,cosinecomponent)+FixedMul(yoff,sinecomponent); + yoff = -FixedMul(oldxoff,sinecomponent)+FixedMul(yoff,cosinecomponent); + } } +#ifdef POLYOBJECTS_PLANES + if (polyobj) + { + if (polyobj->angle != 0) + { + angle_t fineshift = polyobj->angle >> ANGLETOFINESHIFT; + xoff -= FixedMul(FINECOSINE(fineshift), polyobj->centerPt.x)+FixedMul(FINESINE(fineshift), polyobj->centerPt.y); + yoff -= FixedMul(FINESINE(fineshift), polyobj->centerPt.x)-FixedMul(FINECOSINE(fineshift), polyobj->centerPt.y); + } + else + { + xoff -= polyobj->centerPt.x; + yoff += polyobj->centerPt.y; + } + } +#endif + // This appears to fix the Nimbus Ruins sky bug. if (picnum == skyflatnum && pfloor) { @@ -488,6 +506,7 @@ visplane_t *R_FindPlane(fixed_t height, INT32 picnum, INT32 lightlevel, && !pfloor && !check->ffloor && check->viewx == viewx && check->viewy == viewy && check->viewz == viewz && check->viewangle == viewangle + && check->plangle == plangle #ifdef ESLOPE && check->slope == slope #endif @@ -974,23 +993,65 @@ void R_DrawSinglePlane(visplane_t *pl) #ifdef ESLOPE if (pl->slope) { // Potentially override other stuff for now cus we're mean. :< But draw a slope plane! - // I copied ZDoom's code and adapted it to SRB2... -Red + // I copied ZDoom's code and adapted it to SRB2... -fickle floatv3_t p, m, n; float ang; float vx, vy, vz; - float fudge; // compiler complains when P_GetZAt is used in FLOAT_TO_FIXED directly // use this as a temp var to store P_GetZAt's return value each time fixed_t temp; + // Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -fickle + const float fudge = ((1<plangle & (ANGLE_90-1)); - xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); - yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); + if (hack) + { + /* + Essentially: We can't & the components along the regular axes when the plane is rotated. + This is because the distance on each regular axis in order to loop is different. + We rotate them, & the components, add them together, & them again, and then rotate them back. + These three seperate & operations are done per axis in order to prevent overflows. + toast 10/04/17 + --- + ...of coooourse, this still isn't perfect. but it looks... merely kind of grody, rather than + completely wrong? idk. i'm just backporting this to kart right now. if anyone else wants to + ever try dig around: it's drifting towards 0,0, and no, multiplying by fudge doesn't fix it. + toast 27/09/18 + */ - // Okay, look, don't ask me why this works, but without this setup there's a disgusting-looking misalignment with the textures. -Red - fudge = ((1<>ANGLETOFINESHIFT); + const fixed_t sinecomponent = FINESINE(hack>>ANGLETOFINESHIFT); + + const fixed_t modmask = ((1 << (32-nflatshiftup)) - 1); + + fixed_t ox = (FixedMul(pl->slope->o.x,cosinecomponent) & modmask) - (FixedMul(pl->slope->o.y,sinecomponent) & modmask); + fixed_t oy = (-FixedMul(pl->slope->o.x,sinecomponent) & modmask) - (FixedMul(pl->slope->o.y,cosinecomponent) & modmask); + + temp = ox & modmask; + oy &= modmask; + ox = FixedMul(temp,cosinecomponent)+FixedMul(oy,-sinecomponent); // negative sine for opposite direction + oy = -FixedMul(temp,-sinecomponent)+FixedMul(oy,cosinecomponent); + + temp = xoffs; + xoffs = (FixedMul(temp,cosinecomponent) & modmask) + (FixedMul(yoffs,sinecomponent) & modmask); + yoffs = (-FixedMul(temp,sinecomponent) & modmask) + (FixedMul(yoffs,cosinecomponent) & modmask); + + temp = xoffs & modmask; + yoffs &= modmask; + xoffs = FixedMul(temp,cosinecomponent)+FixedMul(yoffs,-sinecomponent); // ditto + yoffs = -FixedMul(temp,-sinecomponent)+FixedMul(yoffs,cosinecomponent); + + xoffs -= (pl->slope->o.x - ox); + yoffs += (pl->slope->o.y + oy); + } + else + { + xoffs &= ((1 << (32-nflatshiftup))-1); + yoffs &= ((1 << (32-nflatshiftup))-1); + xoffs -= (pl->slope->o.x + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); + yoffs += (pl->slope->o.y + (1 << (31-nflatshiftup))) & ~((1 << (32-nflatshiftup))-1); + } xoffs = (fixed_t)(xoffs*fudge); yoffs = (fixed_t)(yoffs/fudge); From 3b5f195973e63d34076f8f829442319331567b24 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 18:32:07 +0100 Subject: [PATCH 06/44] Spring *panels* now use `sfx_kc2f` again (but pogo spring *items* still do `sfx_kpogos`, in case you were worried). --- src/k_kart.c | 8 ++++---- src/k_kart.h | 2 +- src/lua_baselib.c | 4 ++-- src/p_map.c | 2 +- src/p_mobj.c | 6 +++--- src/p_spec.c | 4 ++-- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f4b9e93a7..20313da95 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3031,7 +3031,7 @@ static void K_DoSPB(player_t *victim, player_t *source) P_DamageMobj(victim->mo, source->mo, source->mo, 65); } -void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) +void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) { const fixed_t vscale = mapheaderinfo[gamemap-1]->mobj_scale + (mo->scale - mapheaderinfo[gamemap-1]->mobj_scale); @@ -3083,8 +3083,8 @@ void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute) else mo->momz = FixedMul(vertispeed, vscale); - if (!mute) - S_StartSound(mo, sfx_kpogos); + if (sound) + S_StartSound(mo, (sound == 1 ? sfx_kc2f : sfx_kpogos)); } void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source) @@ -4775,7 +4775,7 @@ void K_MoveKartPlayer(player_t *player, boolean onground) && !player->kartstuff[k_pogospring]) { K_PlayBoostTaunt(player->mo); - K_DoPogoSpring(player->mo, 32<mo, 32<kartstuff[k_pogospring] = 1; player->kartstuff[k_itemamount]--; } diff --git a/src/k_kart.h b/src/k_kart.h index 7c37ef679..7cab42a59 100644 --- a/src/k_kart.h +++ b/src/k_kart.h @@ -37,7 +37,7 @@ void K_SpawnSparkleTrail(mobj_t *mo); void K_SpawnWipeoutTrail(mobj_t *mo, boolean translucent); void K_DriftDustHandling(mobj_t *spawner); void K_DoSneaker(player_t *player, boolean doPFlag); -void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, boolean mute); +void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound); void K_KillBananaChain(mobj_t *banana, mobj_t *inflictor, mobj_t *source); void K_UpdateHnextList(player_t *player, boolean clean); void K_DropHnextList(player_t *player); diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 7c44c7962..2d287d0f5 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -2231,11 +2231,11 @@ static int lib_kDoPogoSpring(lua_State *L) { mobj_t *mo = *((mobj_t **)luaL_checkudata(L, 1, META_MOBJ)); fixed_t vertispeed = luaL_checkfixed(L, 2); - boolean mute = luaL_checkboolean(L, 3); + UINT8 sound = luaL_checkinteger(L, 3); NOHUD if (!mo) return LUA_ErrInvalid(L, "mobj_t"); - K_DoPogoSpring(mo, vertispeed, mute); + K_DoPogoSpring(mo, vertispeed, sound); return 0; } diff --git a/src/p_map.c b/src/p_map.c index b249f3628..f6f6b9b5c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -316,7 +316,7 @@ static void P_DoFanAndGasJet(mobj_t *spring, mobj_t *object) break; if (object->player) object->player->kartstuff[k_pogospring] = 1; - K_DoPogoSpring(object, 0, true); + K_DoPogoSpring(object, 0, 0); return; } else diff --git a/src/p_mobj.c b/src/p_mobj.c index 0f0657336..6058267d5 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -8035,7 +8035,7 @@ void P_MobjThinker(mobj_t *mobj) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) - K_DoPogoSpring(mobj, 0, false); + K_DoPogoSpring(mobj, 0, 1); } if (mobj->threshold > 0) @@ -8110,7 +8110,7 @@ void P_MobjThinker(mobj_t *mobj) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) - K_DoPogoSpring(mobj, 0, false); + K_DoPogoSpring(mobj, 0, 1); break; } @@ -8139,7 +8139,7 @@ void P_MobjThinker(mobj_t *mobj) if ((sec2 && GETSECSPECIAL(sec2->special, 3) == 1) || (P_IsObjectOnRealGround(mobj, mobj->subsector->sector) && GETSECSPECIAL(mobj->subsector->sector->special, 3) == 1)) - K_DoPogoSpring(mobj, 0, false); + K_DoPogoSpring(mobj, 0, 1); } if (mobj->threshold > 0) diff --git a/src/p_spec.c b/src/p_spec.c index 86ac8f005..ab47fec3f 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -3790,7 +3790,7 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, minspeed); player->kartstuff[k_pogospring] = 1; - K_DoPogoSpring(player->mo, 0, false); + K_DoPogoSpring(player->mo, 0, 1); } break; @@ -3813,7 +3813,7 @@ DoneSection2: P_InstaThrust(player->mo, player->mo->angle, minspeed); player->kartstuff[k_pogospring] = 2; - K_DoPogoSpring(player->mo, 0, false); + K_DoPogoSpring(player->mo, 0, 1); } break; From 61f3fffe73ae60a9cb9644395fe3b441ce818068 Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 18:39:54 +0100 Subject: [PATCH 07/44] Fix dash-dust spawning not happening when drop-dashing, despite its function being called. --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index 20313da95..650a21492 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -1277,7 +1277,7 @@ static void K_SpawnDashDustRelease(player_t *player) if (!P_IsObjectOnGround(player->mo)) return; - if (player->speed == 0) + if (!player->speed && !player->kartstuff[k_startboost]) return; travelangle = player->mo->angle; From ff773a79c0777af309a4f893110373e7ea27b54f Mon Sep 17 00:00:00 2001 From: toaster Date: Thu, 27 Sep 2018 21:38:19 +0100 Subject: [PATCH 08/44] Disable `cv_joinnextround` behind `#define VANILLAJOINNEXTROUND`. --- src/d_clisrv.c | 6 ++++++ src/d_clisrv.h | 6 +++++- src/m_menu.c | 4 +++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 63393690a..97e6e700b 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2920,7 +2920,9 @@ static void Got_KickCmd(UINT8 **p, INT32 playernum) } consvar_t cv_allownewplayer = {"allowjoin", "On", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL }; +#ifdef VANILLAJOINNEXTROUND consvar_t cv_joinnextround = {"joinnextround", "Off", CV_NETVAR, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; /// \todo not done +#endif static CV_PossibleValue_t maxplayers_cons_t[] = {{2, "MIN"}, {MAXPLAYERS, "MAX"}, {0, NULL}}; consvar_t cv_maxplayers = {"maxplayers", "8", CV_SAVE, maxplayers_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL}; static CV_PossibleValue_t resynchattempts_cons_t[] = {{0, "MIN"}, {20, "MAX"}, {0, NULL}}; @@ -2966,7 +2968,9 @@ void D_ClientServerInit(void) RegisterNetXCmd(XD_ADDPLAYER, Got_AddPlayer); #ifndef NONET CV_RegisterVar(&cv_allownewplayer); +#ifdef VANILLAJOINNEXTROUND CV_RegisterVar(&cv_joinnextround); +#endif CV_RegisterVar(&cv_showjoinaddress); CV_RegisterVar(&cv_resynchattempts); CV_RegisterVar(&cv_blamecfail); @@ -3519,8 +3523,10 @@ static void HandleConnect(SINT8 node) // you get a free second before desynch checks. use it wisely. SV_InitResynchVars(node); +#ifdef VANILLAJOINNEXTROUND if (cv_joinnextround.value && gameaction == ga_nothing) G_SetGamestate(GS_WAITINGPLAYERS); +#endif if (!SV_SendServerConfig(node)) { G_SetGamestate(backupstate); diff --git a/src/d_clisrv.h b/src/d_clisrv.h index c8e8b0080..e2a6ed7cc 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -497,7 +497,11 @@ extern UINT32 realpingtable[MAXPLAYERS]; extern UINT32 playerpingtable[MAXPLAYERS]; #endif -extern consvar_t cv_joinnextround, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; +extern consvar_t +#ifdef VANILLAJOINNEXTROUND + cv_joinnextround, +#endif + cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed; // Used in d_net, the only dependence tic_t ExpandTics(INT32 low); diff --git a/src/m_menu.c b/src/m_menu.c index 071fdc421..bfb039c45 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -1537,7 +1537,9 @@ static menuitem_t OP_ServerOptionsMenu[] = #ifndef NONET {IT_STRING | IT_CVAR, NULL, "Max. Player Count", &cv_maxplayers, 90}, {IT_STRING | IT_CVAR, NULL, "Allow Players to Join", &cv_allownewplayer, 100}, - //{IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, +#ifdef VANILLAJOINNEXTROUND + {IT_STRING | IT_CVAR, NULL, "Join on Map Change", &cv_joinnextround, 110}, +#endif {IT_STRING | IT_CVAR, NULL, "Allow WAD Downloading", &cv_downloading, 110}, {IT_STRING | IT_CVAR, NULL, "Attempts to resynchronise", &cv_resynchattempts, 120}, From 585ee5ba06cb9dd74a61559aea60953144c658a2 Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 28 Sep 2018 20:10:22 +0100 Subject: [PATCH 09/44] Some credits tweaks (alphabetical ordering plus new names, plus slight downwards adjustment of `TYLER52`) --- src/f_finale.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/f_finale.c b/src/f_finale.c index 6fabcd96a..1cfc18351 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -525,10 +525,13 @@ static const char *credits[] = { "\1Special Thanks", "Sonic Team Jr. & SRB2", "Bandit \"Bobby\" Cochenour", // i <3 my dog + "Bear", // i <3 MY dog too + "\"Chrispy\"", + "\"DirkTheHusky\"", + "\"fickle\"", // and my sharki "\"Nev3r\"", "\"Ritz\"", "\"Spherallic\"", - "\"DirkTheHusky\"", "", "\1Produced By", "Kart Krew", @@ -554,7 +557,7 @@ static struct { {112, 80+200* 7, "CREDIT10"}, {240, 80+200* 8, "CREDIT05"}, {120, 80+200* 9, "CREDIT06"},*/ - {112, 80+200*10, "TYLER52"}, + {112, 80+100+200*10, "TYLER52"}, {0, 0, NULL} }; From ae0e569cfbca206db67664d1e1daf6e9488c9613 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 12:12:48 +0100 Subject: [PATCH 10/44] Add a `SECTIONRACE` map flag. So far, all it does is prevent the number of laps from exceeding the map default, but it's a base to work off of if we want to add any other changes specifically for section races in future. --- src/dehacked.c | 8 ++++++++ src/doomstat.h | 1 + src/p_setup.c | 4 +++- 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/dehacked.c b/src/dehacked.c index 99d952596..2efdb6bce 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -1308,6 +1308,13 @@ static void readlevelheader(MYFILE *f, INT32 num) else mapheaderinfo[num-1]->levelflags &= ~LF_NOZONE; } + else if (fastcmp(word, "SECTIONRACE")) + { + if (i || word2[0] == 'T' || word2[0] == 'Y') + mapheaderinfo[num-1]->levelflags |= LF_SECTIONRACE; + else + mapheaderinfo[num-1]->levelflags &= ~LF_SECTIONRACE; + } // Individual triggers for menu flags else if (fastcmp(word, "HIDDEN")) @@ -7943,6 +7950,7 @@ struct { {"LF_NOSSMUSIC",LF_NOSSMUSIC}, {"LF_NORELOAD",LF_NORELOAD}, {"LF_NOZONE",LF_NOZONE}, + {"LF_SECTIONRACE",LF_SECTIONRACE}, // And map flags {"LF2_HIDEINMENU",LF2_HIDEINMENU}, {"LF2_HIDEINSTATS",LF2_HIDEINSTATS}, diff --git a/src/doomstat.h b/src/doomstat.h index fc13b0e8c..296c11bfe 100644 --- a/src/doomstat.h +++ b/src/doomstat.h @@ -272,6 +272,7 @@ typedef struct #define LF_NOSSMUSIC 4 ///< Disable Super Sonic music #define LF_NORELOAD 8 ///< Don't reload level on death #define LF_NOZONE 16 ///< Don't include "ZONE" on level title +#define LF_SECTIONRACE 32 ///< Section race level #define LF2_HIDEINMENU 1 ///< Hide in the multiplayer menu #define LF2_HIDEINSTATS 2 ///< Hide in the statistics screen diff --git a/src/p_setup.c b/src/p_setup.c index 6c7b6e927..e705a3f03 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2916,7 +2916,9 @@ boolean P_SetupLevel(boolean skipprecip) } else if (G_RaceGametype() && server) CV_StealthSetValue(&cv_numlaps, - ((netgame || multiplayer) && cv_basenumlaps.value) + ((netgame || multiplayer) && cv_basenumlaps.value + && (!(mapheaderinfo[gamemap - 1]->levelflags & LF_SECTIONRACE) + || (mapheaderinfo[gamemap - 1]->numlaps > cv_basenumlaps.value))) ? cv_basenumlaps.value : mapheaderinfo[gamemap - 1]->numlaps); From 664544379f7f696044607fd18ccec0a453156be8 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 12:27:35 +0100 Subject: [PATCH 11/44] Don't allow a new driftboost of lesser magnitude to completely cancel an existing driftboost. --- src/k_kart.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 650a21492..d3abfcb57 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -4113,7 +4113,8 @@ static void K_KartDrift(player_t *player, boolean onground) && (player->kartstuff[k_driftcharge] >= dsone && player->kartstuff[k_driftcharge] < dstwo) && onground) { - player->kartstuff[k_driftboost] = 20; + if (player->kartstuff[k_driftboost] < 20) + player->kartstuff[k_driftboost] = 20; S_StartSound(player->mo, sfx_s23c); //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; @@ -4123,7 +4124,8 @@ static void K_KartDrift(player_t *player, boolean onground) && player->kartstuff[k_driftcharge] < dsthree && onground) { - player->kartstuff[k_driftboost] = 50; + if (player->kartstuff[k_driftboost] < 50) + player->kartstuff[k_driftboost] = 50; S_StartSound(player->mo, sfx_s23c); //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; @@ -4133,7 +4135,8 @@ static void K_KartDrift(player_t *player, boolean onground) && player->kartstuff[k_driftcharge] >= dsthree && onground) { - player->kartstuff[k_driftboost] = 125; + if (player->kartstuff[k_driftboost] < 125) + player->kartstuff[k_driftboost] = 125; S_StartSound(player->mo, sfx_s23c); //K_SpawnDashDustRelease(player); player->kartstuff[k_driftcharge] = 0; From b7421c72ebf7b536bc8819395691a258e6aef25f Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 12:52:54 +0100 Subject: [PATCH 12/44] Based on netgame comments last night, update the tab rankings info to show less information in race. --- src/hu_stuff.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b486..fe2eb3596 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -2226,22 +2226,13 @@ void HU_DrawTabRankings(INT32 x, INT32 y, playersort_t *tab, INT32 scorelines, I if (G_RaceGametype()) { -#define timestring(time) va("%i:%02i.%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) +#define timestring(time) va("%i'%02i\"%02i", G_TicsToMinutes(time, true), G_TicsToSeconds(time), G_TicsToCentiseconds(time)) if (players[tab[i].num].exiting) - { - V_DrawRightAlignedString(x, y-4, hilicol, "FIN"); V_DrawRightAlignedString(x+rightoffset, y, hilicol, timestring(players[tab[i].num].realtime)); - } else if (players[tab[i].num].pflags & PF_TIMEOVER) - V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "TIME OVER..."); + V_DrawRightAlignedThinString(x+rightoffset, y-1, 0, "NO CONTEST."); else if (circuitmap) - { - V_DrawRightAlignedString(x, y-4, 0, "Lap"); - V_DrawRightAlignedString(x, y+4, 0, va("%d", tab[i].count)); - V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(players[tab[i].num].starposttime)); - } - else - V_DrawRightAlignedString(x+rightoffset, y, 0, timestring(tab[i].count)); + V_DrawRightAlignedString(x+rightoffset, y, 0, va("Lap %d", tab[i].count)); #undef timestring } else From 2cce9a0fcb345b67a169ad1d19a37ed252b48457 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 13:25:13 +0100 Subject: [PATCH 13/44] Allow respawning spectators before starttime is up because they no longer spawn in a condition that allows them to get an unfair advantage (drop dash or its ghetto 2.0-esque predecessor) Also, some camera tweaks: * Force chasecam when exiting, just like it's forced when you're dead and not a spectator. * Force a horizontal camera angle aiming when spectator and dead, to avoid skybox bugs. --- src/p_user.c | 7 ++++--- src/r_main.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index d3407bd65..7646ca6d4 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -7915,7 +7915,7 @@ static void P_DeathThink(player_t *player) /*if (player->deadtimer > 30*TICRATE && !G_RaceGametype()) player->playerstate = PST_REBORN; else if (player->lives > 0 && !G_IsSpecialStage(gamemap)*/ - if (player->lives > 0 && leveltime >= starttime) // *could* you respawn? + if (player->lives > 0 /*&& leveltime >= starttime*/) // *could* you respawn? { // SRB2kart - spawn automatically after 1 second if (player->deadtimer > ((netgame || multiplayer) @@ -8681,9 +8681,10 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall { // Don't let the camera match your movement. thiscam->momz = 0; - + if (player->spectator) + thiscam->aiming = 0; // Only let the camera go a little bit downwards. - if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180) + else if (!(mo->eflags & MFE_VERTICALFLIP) && thiscam->aiming < ANGLE_337h && thiscam->aiming > ANGLE_180) thiscam->aiming = ANGLE_337h; else if (mo->eflags & MFE_VERTICALFLIP && thiscam->aiming > ANGLE_22h && thiscam->aiming < ANGLE_180) thiscam->aiming = ANGLE_22h; diff --git a/src/r_main.c b/src/r_main.c index 5990224c2..5da98c8ec 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1094,7 +1094,7 @@ void R_SetupFrame(player_t *player, boolean skybox) chasecam = (cv_chasecam.value != 0); } - if (player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD) + if (player->playerstate == PST_DEAD || player->exiting) chasecam = true; // force chasecam on else if (player->spectator) // no spectator chasecam chasecam = false; // force chasecam off From b5e090f0dff6ffe27974c4a9e6f61fdac1703056 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 13:51:23 +0100 Subject: [PATCH 14/44] Correct some inconsistencies I missed in the previous commit. --- src/p_user.c | 2 +- src/r_main.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/p_user.c b/src/p_user.c index 7646ca6d4..f34b1a2e9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8188,7 +8188,7 @@ boolean P_MoveChaseCamera(player_t *player, camera_t *thiscam, boolean resetcall || (leveltime < introtime)); // Kart intro cam #endif - if (!(player->climbing || (player->pflags & PF_NIGHTSMODE) || player->playerstate == PST_DEAD)) + if (!(player->playerstate == PST_DEAD || player->exiting)) { if (player->spectator) // force cam off for spectators return true; diff --git a/src/r_main.c b/src/r_main.c index 5da98c8ec..d83ce8d06 100644 --- a/src/r_main.c +++ b/src/r_main.c @@ -1094,10 +1094,10 @@ void R_SetupFrame(player_t *player, boolean skybox) chasecam = (cv_chasecam.value != 0); } - if (player->playerstate == PST_DEAD || player->exiting) - chasecam = true; // force chasecam on - else if (player->spectator) // no spectator chasecam + if (player->spectator) // no spectator chasecam chasecam = false; // force chasecam off + else if (player->playerstate == PST_DEAD || player->exiting) + chasecam = true; // force chasecam on if (chasecam && !thiscam->chase) { From 05332a4f0fd7cc7dc569bea912e1ce666919ecdf Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 18:10:12 +0100 Subject: [PATCH 15/44] Minor HUD offset tweak for splitscreen eggnum. --- src/k_kart.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/k_kart.c b/src/k_kart.c index d3abfcb57..5c99a0402 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -5929,7 +5929,7 @@ static void K_drawKartItem(void) // Quick Eggman numbers if (stplyr->kartstuff[k_eggmanexplode] > 1 /*&& stplyr->kartstuff[k_eggmanexplode] <= 3*TICRATE*/) - V_DrawScaledPatch(ITEM_X+17, ITEM_Y+13, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); + V_DrawScaledPatch(ITEM_X+17-offset, ITEM_Y+13-offset, V_HUDTRANS|splitflags, kp_eggnum[min(3, G_TicsToSeconds(stplyr->kartstuff[k_eggmanexplode]))]); } void K_drawKartTimestamp(tic_t drawtime, INT32 TX, INT32 TY, INT16 emblemmap, boolean playing) From 6146314415a4c9801fb0432b8d1665486977e0b8 Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Mon, 1 Oct 2018 20:23:56 +0200 Subject: [PATCH 16/44] Fix /me and sayteam, except sayteam now actually doesn't do anything anymore. --- src/hu_stuff.c | 40 ++++++++++++++++++++++++++++------------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b486..67a656455 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -721,7 +721,20 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) { cstart = "\x86"; // grey name textcolor = "\x86"; - } + } + else if (target == -1) // say team + { + if (players[playernum].ctfteam == 1) // red + { + cstart = "\x85"; + textcolor = "\x85"; + } + else // blue + { + cstart = "\x84"; + textcolor = "\x84"; + } + } else { const UINT8 color = players[playernum].skincolor; @@ -783,13 +796,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) // '\4' makes the message yellow and beeps; '\3' just beeps. if (action) { - fmt = "\3* %s%s%s%s \x82%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! - fmt2 = "* %s%s%s%s \x82%s"; - } - else if (target == 0) // To everyone - { - fmt = "\3%s<%s%s%s>\x80 %s%s\n"; - fmt2 = "%s<%s%s%s>\x80 %s%s"; + fmt = "\3* %s%s%s%s \x82%s%s\n"; // don't make /me yellow, yellow will be for mentions and PMs! + fmt2 = "* %s%s%s%s \x82%s%s"; } else if (target-1 == consoleplayer) // To you { @@ -809,7 +817,12 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) fmt2 = "%s<%s%s>%s\x80 %s%s"; } - else // To your team + else // To everyone or sayteam, it doesn't change anything. + { + fmt = "\3%s<%s%s%s>\x80 %s%s\n"; + fmt2 = "%s<%s%s%s>\x80 %s%s"; + } + /*else // To your team { if (players[playernum].ctfteam == 1) // red prefix = "\x85[TEAM]"; @@ -820,8 +833,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) fmt = "\3%s<%s%s>\x80%s %s%s\n"; fmt2 = "%s<%s%s>\x80%s %s%s"; - - } + }*/ HU_AddChatText(va(fmt2, prefix, cstart, dispname, cend, textcolor, msg)); // add it reguardless, in case we decide to change our mind about our chat type. @@ -1070,7 +1082,8 @@ boolean HU_Responder(event_t *ev) return false; chat_on = true; w_chat[0] = 0; - teamtalk = true; + teamtalk = false; // CHANGE THIS TO TRUE TO MAKE SAYTEAM WORK AGAIN + //teamtalk = true; chat_scrollmedown = true; return true; } @@ -1955,10 +1968,13 @@ void HU_Drawer(void) } else { + if (netgame) // Don't draw it outside, I know it leads to stupid stuff. + { chat_scrolltime = 0; // do scroll anyway. typelines = 1; // make sure that the chat doesn't have a weird blinking huge ass square if we typed a lot last time. if (!OLDCHAT) HU_drawMiniChat(); // draw messages in a cool fashion. + } } if (netgame) // would handle that in hu_drawminichat, but it's actually kinda awkward when you're typing a lot of messages. (only handle that in netgames duh) From 76a2079671ca3ec96cd47e2c7e50a0992b49ccf0 Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 21:23:00 +0100 Subject: [PATCH 17/44] Include srb2.org in the credits per Rob's wishes. --- 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 1cfc18351..484ffcff8 100644 --- a/src/f_finale.c +++ b/src/f_finale.c @@ -523,7 +523,7 @@ static const char *credits[] = { "\"VirtAnderson\"", "", "\1Special Thanks", - "Sonic Team Jr. & SRB2", + "Sonic Team Jr. & SRB2 (www.srb2.org)", "Bandit \"Bobby\" Cochenour", // i <3 my dog "Bear", // i <3 MY dog too "\"Chrispy\"", From 9f5b2bdeb8185354e34f9c814d59f140d14fcc9b Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 21:48:52 +0100 Subject: [PATCH 18/44] Modified SPB to not route through P_DamageMobj (so wehave more control over the shield dropping/item obliteration, given Sryder picking up his own Thundershield...) --- src/k_kart.c | 25 +++++++++++++++++++++---- src/p_inter.c | 13 ------------- 2 files changed, 21 insertions(+), 17 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index 5c99a0402..f51abb1a5 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3016,7 +3016,7 @@ static void K_DoShrink(player_t *player) } } -static void K_DoSPB(player_t *victim, player_t *source) +static void K_DoSPB(player_t *victim) { //INT32 i; S_StartSound(victim->mo, sfx_bkpoof); // Sound the BANG! @@ -3027,8 +3027,25 @@ static void K_DoSPB(player_t *victim, player_t *source) P_FlashPal(&players[i], PAL_NUKE, 10); }*/ - if (victim->mo && !victim->spectator) - P_DamageMobj(victim->mo, source->mo, source->mo, 65); + if (!victim->mo || !victim->mo->health || victim->spectator) + return; + + { + mobj_t *spbexplode; + + if (!victim->kartstuff[k_invincibilitytimer] && !victim->kartstuff[k_growshrinktimer]) + { + K_DropHnextList(victim); + K_StripItems(victim); + } + + victim->powers[pw_flashing] = 0; + + spbexplode = P_SpawnMobj(victim->mo->x, victim->mo->y, victim->mo->z, MT_BLUEEXPLOSION); + + if (playeringame[spbplayer] && !players[spbplayer].spectator && players[spbplayer].mo) + P_SetTarget(&spbexplode->target, players[spbplayer].mo); + } } void K_DoPogoSpring(mobj_t *mo, fixed_t vertispeed, UINT8 sound) @@ -3820,7 +3837,7 @@ void K_KartPlayerThink(player_t *player, ticcmd_t *cmd) if (player->kartstuff[k_deathsentence]) { if (player->kartstuff[k_deathsentence] == 1) - K_DoSPB(player, &players[spbplayer]); + K_DoSPB(player); player->kartstuff[k_deathsentence]--; } diff --git a/src/p_inter.c b/src/p_inter.c index 4a120a42a..bd02da429 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -3385,19 +3385,6 @@ boolean P_DamageMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source, INT32 da S_StartSound(player->mo, sfx_kc59); return true; } - - // Self-Propelled Bomb - if (damage == 65) - { - mobj_t *spbexplode; - if (player == source->player) - return false; - // Just need to do this now! Being thrown upwards is done by the explosion. - //P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUELIGHTNING); - spbexplode = P_SpawnMobj(player->mo->x, player->mo->y, player->mo->z, MT_BLUEEXPLOSION); - P_SetTarget(&spbexplode->target, source); - return true; - } //} // Sudden-Death mode From b23d0d12a88da3c16e14abd3a30b98047bade79a Mon Sep 17 00:00:00 2001 From: toaster Date: Mon, 1 Oct 2018 22:44:17 +0100 Subject: [PATCH 19/44] Wrong bracket level for flashing-set. --- src/k_kart.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index f51abb1a5..6d1ef8af1 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3037,9 +3037,9 @@ static void K_DoSPB(player_t *victim) { K_DropHnextList(victim); K_StripItems(victim); - } - victim->powers[pw_flashing] = 0; + victim->powers[pw_flashing] = 0; + } spbexplode = P_SpawnMobj(victim->mo->x, victim->mo->y, victim->mo->z, MT_BLUEEXPLOSION); From 98768ac23617f3cacf8601ca6cb2a9d02aa22de9 Mon Sep 17 00:00:00 2001 From: toaster Date: Tue, 2 Oct 2018 16:51:17 +0100 Subject: [PATCH 20/44] Fix incorrect alignment of selected-level Ruby in vote drawer. --- src/y_inter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/y_inter.c b/src/y_inter.c index e26d49737..46e15e399 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -1137,7 +1137,7 @@ void Y_VoteDrawer(void) else { V_DrawFixedPatch((x+40)< Date: Tue, 2 Oct 2018 16:52:02 +0100 Subject: [PATCH 21/44] Revert "Just realised the inputwheel jittering in Sryder's videos was my fault, so fix this even better" This reverts commit 6835b17f699809f102b8b43cc791bbc04581f4d6. --- src/k_kart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/k_kart.c b/src/k_kart.c index 6d1ef8af1..ef909b5f9 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -7116,7 +7116,10 @@ static void K_drawInput(void) } if (pn < 0) + { splitflags |= V_FLIP; // right turn + x--; + } target = abs(pn); if (target > 4) From 5e8799a965f2da4a08f2c7ee0709775509726de5 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:04:41 +0100 Subject: [PATCH 22/44] Nuke a bunch of iteration things that have no purpose in SRB2Kart. A full explanation of my reasoning and what it affects is as follows. p_inter.c - Everything to do with setting states for starposts In SRB2Kart, starposts are invisble. We don't need to loop through all thinkers just to set their states when there's no visible effect of the state-setting. In addition, it has no consequences for gameplay - starposts have long been silent here, and all checking is done regarding their health, not their state. Remove extremely low-traffic conditionals (MT_FLINGEMERALD collision height extension, for example) These objects serve no functional purpose during regular SRB2Kart gameplay. Why should every other object have to pay an admittedly minor performance hit just for them? Disable all mechanisms of damaging bosses or enemies with the player's physical contact With the exception of Sapphire Coast, no MF_ENEMY objects exist in the entirety of the standard roster. In addition, the conditions for damaging the enemies were impossible to achieve, because they required vanilla SRB2 mechanics such as "jumping", "spindashing", or "super". Therefore, they can be safely commented out. Disable NiGHTS-related material (excepting bumper, hoop, and wing-emblem objects) NiGHTS is fundamentally incompatible with regular kart gameplay and I believe was already broken. Therefore, any mechanism which enters, aids, or abets it can be safely disabled. Comment out Tag mechanisms Tag is the only vanilla multiplayer gametype which has sufficient gameplay depth and complexity (HEYOOOOOOOOO) to require dedicated thinking in and of itself in order to manage. This thinking is irrelevant to Kart's functioning, and can be neutered easily. d_clisrv.c Comment out Tag mechanisms See p_inter.c d_netcmd.c Disable several devmode commands which are irrelevant to SRB2Kart gameplay When investigating for references to NiGHTS material, I discovered that these remained untouched. In order to present a more coherent game, I have hidden the ones that serve no purpose for us. Comment out Tag mechanisms See p_inter.c g_game.c Disable NiGHTS-related material See p_inter.c Disable some team-related material Teams are not present in SRB2Kart at present. Obviously we'd want to reconsider for future, but it doesn't need to be run right now. Everything to do with setting states for starposts See p_inter.c m_cheat.c Disable several devmode commands which are irrelevant to SRB2Kart gameplay See d_netcmd.c p_map.c Remove extremely low-traffic conditionals (MT_EGGSHIELD collision, for example) See p_inter.c Disable NiGHTS-related material See p_inter.c p_mobj.c Disable P_EmeraldManager Power stones, despite their relevance in vanilla Match, are not in SRB2Kart's Battle. No management of nonexistent emeralds is required. p_setup.c Everything to do with setting states for starposts See p_inter.c p_spec.c Disable NiGHTS-related material See p_inter.c Everything to do with setting states for starposts See p_inter.c p_telept.c Everything to do with setting states for starposts See p_inter.c p_tick.c Disable some team-related material See g_game.c Disable P_EmeraldManager See p_mobj.c Do not run shields Shield objects are not run under the vanilla system; the Thunder Shield is a domain-specific recreation using a standard mobjthinker. Do not run special stages SRB2Kart does not have special stages. Comment out Tag mechanisms See p_inter.c y_inter.c Disable some team-related material See g_game.c p_user.c Disable NiGHTS-related material See p_inter.c Disable 2d movement for players 2D mode? In a kart racer? :nick: --- src/d_clisrv.c | 4 +- src/d_netcmd.c | 12 ++--- src/g_game.c | 10 ++--- src/m_cheat.c | 12 ++--- src/m_cheat.h | 8 ++-- src/p_inter.c | 120 +++++++++---------------------------------------- src/p_local.h | 13 +++--- src/p_map.c | 41 ++++++++--------- src/p_mobj.c | 4 +- src/p_setup.c | 1 - src/p_spec.c | 9 ++-- src/p_telept.c | 4 -- src/p_tick.c | 16 +++---- src/p_user.c | 56 ++++++++--------------- src/y_inter.c | 4 +- 15 files changed, 102 insertions(+), 212 deletions(-) diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 63393690a..4dc5ed7ef 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2491,9 +2491,9 @@ static void CL_RemovePlayer(INT32 playernum) LUA_InvalidatePlayer(&players[playernum]); #endif - if (G_TagGametype()) //Check if you still have a game. Location flexible. =P + /*if (G_TagGametype()) //Check if you still have a game. Location flexible. =P P_CheckSurvivors(); - else if (G_BattleGametype()) // SRB2Kart + else*/ if (G_BattleGametype()) // SRB2Kart K_CheckBumpers(); else if (G_RaceGametype()) P_CheckRacers(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 144e4bf94..76ea3d6fc 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -915,19 +915,19 @@ void D_RegisterClientCommands(void) COM_AddCommand("noclip", Command_CheatNoClip_f); COM_AddCommand("god", Command_CheatGod_f); COM_AddCommand("notarget", Command_CheatNoTarget_f); - COM_AddCommand("getallemeralds", Command_Getallemeralds_f); + /*COM_AddCommand("getallemeralds", Command_Getallemeralds_f); COM_AddCommand("resetemeralds", Command_Resetemeralds_f); COM_AddCommand("setrings", Command_Setrings_f); COM_AddCommand("setlives", Command_Setlives_f); - COM_AddCommand("setcontinues", Command_Setcontinues_f); + COM_AddCommand("setcontinues", Command_Setcontinues_f);*/ COM_AddCommand("devmode", Command_Devmode_f); COM_AddCommand("savecheckpoint", Command_Savecheckpoint_f); COM_AddCommand("scale", Command_Scale_f); COM_AddCommand("gravflip", Command_Gravflip_f); COM_AddCommand("hurtme", Command_Hurtme_f); - COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); + /*COM_AddCommand("jumptoaxis", Command_JumpToAxis_f); COM_AddCommand("charability", Command_Charability_f); - COM_AddCommand("charspeed", Command_Charspeed_f); + COM_AddCommand("charspeed", Command_Charspeed_f);*/ COM_AddCommand("teleport", Command_Teleport_f); COM_AddCommand("rteleport", Command_RTeleport_f); COM_AddCommand("skynum", Command_Skynum_f); @@ -3260,9 +3260,9 @@ static void Got_Teamchange(UINT8 **cp, INT32 playernum) } // In tag, check to see if you still have a game. - if (G_TagGametype()) + /*if (G_TagGametype()) P_CheckSurvivors(); - else if (G_BattleGametype()) + else*/ if (G_BattleGametype()) K_CheckBumpers(); // SRB2Kart else if (G_RaceGametype()) P_CheckRacers(); // also SRB2Kart diff --git a/src/g_game.c b/src/g_game.c index e501fa569..5c9af3ed7 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2554,15 +2554,15 @@ void G_PlayerReborn(INT32 player) p->maxlink = 0; // If NiGHTS, find lowest mare to start with. - p->mare = P_FindLowestMare(); + p->mare = 0; /*P_FindLowestMare(); CONS_Debug(DBG_NIGHTS, M_GetText("Current mare is %d\n"), p->mare); if (p->mare == 255) - p->mare = 0; + p->mare = 0;*/ // Check to make sure their color didn't change somehow... - if (G_GametypeHasTeams()) + /*if (G_GametypeHasTeams()) { if (p->ctfteam == 1 && p->skincolor != skincolor_redteam) { @@ -2586,7 +2586,7 @@ void G_PlayerReborn(INT32 player) else if (p == &players[fourthdisplayplayer]) CV_SetValue(&cv_playercolor4, skincolor_blueteam); } - } + }*/ } // @@ -2967,8 +2967,6 @@ void G_DoReborn(INT32 playernum) P_LoadThingsOnly(); - P_ClearStarPost(player->starpostnum); - // Do a wipe wipegamestate = -1; diff --git a/src/m_cheat.c b/src/m_cheat.c index 99b96d991..e57a85ae2 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -377,7 +377,7 @@ void Command_Hurtme_f(void) } // Moves the NiGHTS player to another axis within the current mare -void Command_JumpToAxis_f(void) +/*void Command_JumpToAxis_f(void) { REQUIRE_DEVMODE; REQUIRE_INLEVEL; @@ -438,7 +438,7 @@ void Command_Charspeed_f(void) players[consoleplayer].actionspd = atoi(COM_Argv(2))< : set character speed\n")); -} +}*/ void Command_RTeleport_f(void) { @@ -683,7 +683,7 @@ void Command_Savecheckpoint_f(void) } // Like M_GetAllEmeralds() but for console devmode junkies. -void Command_Getallemeralds_f(void) +/*void Command_Getallemeralds_f(void) { REQUIRE_SINGLEPLAYER; REQUIRE_NOULTIMATE; @@ -702,7 +702,7 @@ void Command_Resetemeralds_f(void) emeralds = 0; CONS_Printf(M_GetText("Emeralds reset to zero.\n")); -} +}*/ void Command_Devmode_f(void) { @@ -730,7 +730,7 @@ void Command_Devmode_f(void) G_SetGameModified(multiplayer); } -void Command_Setrings_f(void) +/*void Command_Setrings_f(void) { REQUIRE_INLEVEL; REQUIRE_SINGLEPLAYER; @@ -785,7 +785,7 @@ void Command_Setcontinues_f(void) G_SetGameModified(multiplayer); } -} +}*/ // // OBJECTPLACE (and related variables) diff --git a/src/m_cheat.h b/src/m_cheat.h index 951c7a16a..3b5a1d0fb 100644 --- a/src/m_cheat.h +++ b/src/m_cheat.h @@ -48,18 +48,18 @@ void Command_CheatNoClip_f(void); void Command_CheatGod_f(void); void Command_CheatNoTarget_f(void); void Command_Savecheckpoint_f(void); -void Command_Getallemeralds_f(void); +/*void Command_Getallemeralds_f(void); void Command_Resetemeralds_f(void); void Command_Setrings_f(void); void Command_Setlives_f(void); -void Command_Setcontinues_f(void); +void Command_Setcontinues_f(void);*/ void Command_Devmode_f(void); void Command_Scale_f(void); void Command_Gravflip_f(void); void Command_Hurtme_f(void); -void Command_JumpToAxis_f(void); +/*void Command_JumpToAxis_f(void); void Command_Charability_f(void); -void Command_Charspeed_f(void); +void Command_Charspeed_f(void);*/ void Command_Teleport_f(void); void Command_RTeleport_f(void); void Command_Skynum_f(void); diff --git a/src/p_inter.c b/src/p_inter.c index 4a120a42a..23c6ffbd3 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -96,55 +96,6 @@ void P_RampConstant(const BasicFF_t *FFInfo, INT32 Start, INT32 End) // GET STUFF // -/** Makes sure all previous starposts are cleared. - * For instance, hitting starpost 5 will clear starposts 1 through 4, even if - * you didn't touch them. This is how the classic games work, although it can - * lead to bizarre situations on levels that allow you to make a circuit. - * - * \param postnum The number of the starpost just touched. - */ -void P_ClearStarPost(INT32 postnum) -{ - thinker_t *th; - mobj_t *mo2; - - // scan the thinkers - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo2 = (mobj_t *)th; - - if (mo2->type == MT_STARPOST && mo2->health <= postnum) - P_SetMobjState(mo2, mo2->info->seestate); - } - return; -} - -// -// P_ResetStarposts -// -// Resets all starposts back to their spawn state, used on A_Mixup and some other things. -// -void P_ResetStarposts(void) -{ - // Search through all the thinkers. - thinker_t *th; - mobj_t *post; - - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - post = (mobj_t *)th; - - if (post->type == MT_STARPOST) - P_SetMobjState(post, post->info->spawnstate); - } -} - // // P_CanPickupItem // @@ -299,14 +250,14 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (heightcheck) { - if (special->type == MT_FLINGEMERALD) // little hack here... + /*if (special->type == MT_FLINGEMERALD) // little hack here... { // flingemerald sprites are low to the ground, so extend collision radius down some. if (toucher->z > (special->z + special->height)) return; if (special->z - special->height > (toucher->z + toucher->height)) return; } - else + else*/ { if (toucher->momz < 0) { if (toucher->z + toucher->momz > special->z + special->height) @@ -341,7 +292,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) if (special->flags & MF_BOSS) { - if (special->type == MT_BLACKEGGMAN) + /*if (special->type == MT_BLACKEGGMAN) { P_DamageMobj(toucher, special, special, 1); // ouch return; @@ -357,7 +308,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) toucher->momy = -toucher->momy; P_DamageMobj(special, toucher, toucher, 1); } - /* else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) && player->charability == CA_FLY @@ -368,8 +318,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(special, toucher, toucher, 1); } - */ // SRB2kart - Removed: No more fly states - else + // SRB2kart - Removed: No more fly states + else*/ P_DamageMobj(toucher, special, special, 1); return; @@ -379,7 +329,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) //////////////////////////////////////////////////////// /////ENEMIES!!////////////////////////////////////////// //////////////////////////////////////////////////////// - if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) + /*if (special->type == MT_GSNAPPER && !(((player->pflags & PF_NIGHTSMODE) && (player->pflags & PF_DRILLING)) || player->powers[pw_invulnerability] || player->powers[pw_super]) && toucher->z < special->z + special->height && toucher->z + toucher->height > special->z) { @@ -401,7 +351,6 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(special, toucher, toucher, 1); } - /* else if (((toucher->z < special->z && !(toucher->eflags & MFE_VERTICALFLIP)) || (toucher->z + toucher->height > special->z + special->height && (toucher->eflags & MFE_VERTICALFLIP))) // Flame is bad at logic - JTE && player->charability == CA_FLY @@ -413,8 +362,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) P_DamageMobj(special, toucher, toucher, 1); } - */ // SRB2kart - Removed: No more fly states - else + // SRB2kart - Removed: No more fly states + else*/ P_DamageMobj(toucher, special, special, 1); return; @@ -843,7 +792,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // ********************************** // // NiGHTS gameplay items and powerups // // ********************************** // - case MT_NIGHTSDRONE: + /*case MT_NIGHTSDRONE: if (player->bot) return; if (player->exiting) @@ -1034,7 +983,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) // Clear text player->texttimer = 0; - return; + return;*/ case MT_NIGHTSBUMPER: // Don't trigger if the stage is ended/failed if (player->exiting) @@ -1102,7 +1051,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) } } return; - case MT_NIGHTSSUPERLOOP: + /*case MT_NIGHTSSUPERLOOP: if (player->bot || !(player->pflags & PF_NIGHTSMODE)) return; if (!G_IsSpecialStage(gamemap)) @@ -1235,7 +1184,7 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) HU_SetCEchoDuration(4); HU_DoCEcho(M_GetText("\\\\\\\\\\\\\\\\Link Freeze")); } - break; + break;*/ case MT_NIGHTSWING: if (G_IsSpecialStage(gamemap) && useNightsSS) { // Pseudo-ring. @@ -1387,35 +1336,8 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) player->starpostangle = special->angle; player->starpostnum = special->health; player->starpostcount++; - P_ClearStarPost(special->health); - // Find all starposts in the level with this value. - { - thinker_t *th; - mobj_t *mo2; - - for (th = thinkercap.next; th != &thinkercap; th = th->next) - { - if (th->function.acp1 != (actionf_p1)P_MobjThinker) - continue; - - mo2 = (mobj_t *)th; - - if (mo2 == special) - continue; - - if (mo2->type == MT_STARPOST && mo2->health == special->health) - { - if (!(netgame && circuitmap && player != &players[consoleplayer])) - P_SetMobjState(mo2, mo2->info->painstate); - } - } - } - - S_StartSound(toucher, special->info->painsound); - - if (!(netgame && circuitmap && player != &players[consoleplayer])) - P_SetMobjState(special, special->info->painstate); + //S_StartSound(toucher, special->info->painsound); return; case MT_FAKEMOBILE: @@ -1914,7 +1836,7 @@ void P_CheckTimeLimit(void) //Tagmode round end but only on the tic before the //XD_EXITLEVEL packet is received by all players. - if (G_TagGametype()) + /*if (G_TagGametype()) { if (leveltime == (timelimitintics + 1)) { @@ -1931,7 +1853,7 @@ void P_CheckTimeLimit(void) } //Optional tie-breaker for Match/CTF - else if (cv_overtime.value) + else*/ if (cv_overtime.value) { INT32 playerarray[MAXPLAYERS]; INT32 tempplayer = 0; @@ -2064,7 +1986,7 @@ void P_CheckPointLimit(void) /*Checks for untagged remaining players in both tag derivitave modes. *If no untagged players remain, end the round. *Also serves as error checking if the only IT player leaves.*/ -void P_CheckSurvivors(void) +/*void P_CheckSurvivors(void) { INT32 i; INT32 survivors = 0; @@ -2144,7 +2066,7 @@ void P_CheckSurvivors(void) if (server) SendNetXCmd(XD_EXITLEVEL, NULL, 0); } -} +}*/ // Checks whether or not to end a race netgame. boolean P_CheckRacers(void) @@ -2444,7 +2366,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) localaiming4 = 0; //tag deaths handled differently in suicide cases. Don't count spectators! - if (G_TagGametype() + /*if (G_TagGametype() && !(target->player->pflags & PF_TAGIT) && (!source || !source->player) && !(target->player->spectator)) { // if you accidentally die before you run out of time to hide, ignore it. @@ -2478,7 +2400,7 @@ void P_KillMobj(mobj_t *target, mobj_t *inflictor, mobj_t *source) } } } - else if (G_BattleGametype()) + else*/ if (G_BattleGametype()) K_CheckBumpers(); target->player->kartstuff[k_pogospring] = 0; @@ -2841,7 +2763,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou } // The tag occurs so long as you aren't shooting another tagger with friendlyfire on. - if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) + /*if (source->player->pflags & PF_TAGIT && !(player->pflags & PF_TAGIT)) { P_AddPlayerScore(source->player, 1); //award points to tagger. P_HitDeathMessages(player, inflictor, source); @@ -2859,7 +2781,7 @@ static inline boolean P_TagDamage(mobj_t *target, mobj_t *inflictor, mobj_t *sou //checks if tagger has tagged all players, if so, end round early. P_CheckSurvivors(); - } + }*/ P_DoPlayerPain(player, source, inflictor); diff --git a/src/p_local.h b/src/p_local.h index 51676a2c3..30bf38511 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -172,7 +172,7 @@ void P_PlayerThink(player_t *player); void P_PlayerAfterThink(player_t *player); void P_DoPlayerExit(player_t *player); void P_DoTimeOver(player_t *player); -void P_NightserizePlayer(player_t *player, INT32 ptime); +//void P_NightserizePlayer(player_t *player, INT32 ptime); void P_InstaThrust(mobj_t *mo, angle_t angle, fixed_t move); fixed_t P_ReturnThrustX(mobj_t *mo, angle_t angle, fixed_t move); @@ -185,12 +185,12 @@ void P_HomingAttack(mobj_t *source, mobj_t *enemy); /// \todo doesn't belong in //boolean P_SuperReady(player_t *player); void P_DoJump(player_t *player, boolean soundandstate); boolean P_AnalogMove(player_t *player); -boolean P_TransferToNextMare(player_t *player); -UINT8 P_FindLowestMare(void); +/*boolean P_TransferToNextMare(player_t *player); +UINT8 P_FindLowestMare(void);*/ UINT8 P_FindLowestLap(void); UINT8 P_FindHighestLap(void); void P_FindEmerald(void); -void P_TransferToAxis(player_t *player, INT32 axisnum); +//void P_TransferToAxis(player_t *player, INT32 axisnum); boolean P_PlayerMoving(INT32 pnum); void P_SpawnThokMobj(player_t *player); void P_SpawnSpinMobj(player_t *player, mobjtype_t type); @@ -406,12 +406,9 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck); void P_PlayerFlagBurst(player_t *player, boolean toss); void P_CheckTimeLimit(void); void P_CheckPointLimit(void); -void P_CheckSurvivors(void); +//void P_CheckSurvivors(void); boolean P_CheckRacers(void); -void P_ClearStarPost(INT32 postnum); -void P_ResetStarposts(void); - boolean P_CanPickupItem(player_t *player, UINT8 weapon); void P_DoNightsScore(player_t *player); diff --git a/src/p_map.c b/src/p_map.c index b249f3628..0b4d8225e 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -469,7 +469,7 @@ static boolean PIT_CheckThing(mobj_t *thing) #endif // Metal Sonic destroys tiny baby objects. - if (tmthing->type == MT_METALSONIC_RACE + /*if (tmthing->type == MT_METALSONIC_RACE && (thing->flags & (MF_MISSILE|MF_ENEMY|MF_BOSS) || thing->type == MT_SPIKE)) { if ((thing->flags & (MF_ENEMY|MF_BOSS)) && (thing->health <= 0 || !(thing->flags & MF_SHOOTABLE))) @@ -495,7 +495,7 @@ static boolean PIT_CheckThing(mobj_t *thing) P_KillMobj(thing, tmthing, tmthing); } return true; - } + }*/ if (!(thing->flags & (MF_SOLID|MF_SPECIAL|MF_PAIN|MF_SHOOTABLE)) || (thing->flags & MF_NOCLIPTHING)) return true; @@ -647,9 +647,9 @@ static boolean PIT_CheckThing(mobj_t *thing) // check for skulls slamming into things if (tmthing->flags2 & MF2_SKULLFLY) { - if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop! + /*if (tmthing->type == MT_EGGMOBILE) // Don't make Eggman stop! return true; // Let him RUN YOU RIGHT OVER. >:3 - else + else*/ { // see if it went over / under if (tmthing->z > thing->z + thing->height) @@ -1133,7 +1133,7 @@ static boolean PIT_CheckThing(mobj_t *thing) return true; // Missiles ignore Brak's helper. - if (thing->type == MT_BLACKEGGMAN_HELPER) + /*if (thing->type == MT_BLACKEGGMAN_HELPER) return true; // Hurting Brak @@ -1144,9 +1144,9 @@ static boolean PIT_CheckThing(mobj_t *thing) if (!(thing->state >= &states[S_BLACKEGG_PAIN1] && thing->state <= &states[S_BLACKEGG_PAIN35])) P_SetMobjState(thing, thing->info->painstate); return false; - } + }*/ - if (!(thing->flags & MF_SHOOTABLE) && !(thing->type == MT_EGGSHIELD)) + if (!(thing->flags & MF_SHOOTABLE)/* && !(thing->type == MT_EGGSHIELD)*/) { // didn't do any damage return !(thing->flags & MF_SOLID); @@ -1157,7 +1157,7 @@ static boolean PIT_CheckThing(mobj_t *thing) && thing->player->pflags & PF_CARRIED && thing->tracer == tmthing->target) return true; // Don't give rings to your carry player by accident. - if (thing->type == MT_EGGSHIELD) + /*if (thing->type == MT_EGGSHIELD) { fixed_t touchx, touchy; angle_t angle; @@ -1183,14 +1183,14 @@ static boolean PIT_CheckThing(mobj_t *thing) P_KillMobj(thing, tmthing, tmthing); return false; } - } + }*/ if (tmthing->type == MT_SHELL && tmthing->threshold > TICRATE) return true; // damage / explode if (tmthing->flags & MF_ENEMY) // An actual ENEMY! (Like the deton, for example) P_DamageMobj(thing, tmthing, tmthing, 1); - else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player + /*else if (tmthing->type == MT_BLACKEGGMAN_MISSILE && thing->player && (thing->player->pflags & PF_JUMPED) && !thing->player->powers[pw_flashing] && thing->tracer != tmthing @@ -1230,16 +1230,13 @@ static boolean PIT_CheckThing(mobj_t *thing) tmthing->x = thing->x; tmthing->y = thing->y; P_SetThingPosition(tmthing); - } + }*/ else P_DamageMobj(thing, tmthing, tmthing->target, 1); // don't traverse any more - if (tmthing->type == MT_SHELL) - return true; - else - return false; + return (tmthing->type == MT_SHELL); } if (thing->flags & MF_PUSHABLE && (tmthing->player || tmthing->flags & MF_PUSHABLE) @@ -1303,7 +1300,7 @@ static boolean PIT_CheckThing(mobj_t *thing) } // Respawn rings and items - if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) + /*if ((tmthing->type == MT_NIGHTSDRONE || thing->type == MT_NIGHTSDRONE) && (tmthing->player || thing->player)) { mobj_t *droneobj = (tmthing->type == MT_NIGHTSDRONE) ? tmthing : thing; @@ -1323,7 +1320,7 @@ static boolean PIT_CheckThing(mobj_t *thing) } droneobj->extravalue1 = pl->anotherflyangle; droneobj->extravalue2 = (INT32)leveltime + TICRATE; - } + }*/ // check for special pickup if (thing->flags & MF_SPECIAL && tmthing->player && thing->type != MT_POKEY) @@ -1394,7 +1391,7 @@ static boolean PIT_CheckThing(mobj_t *thing) else if (thing->scale > tmthing->scale + (FRACUNIT/8)) K_SquishPlayer(tmthing->player, thing); - // SRB2kart - Starpower! + // SRB2kart - Invincibility! if (tmthing->player->kartstuff[k_invincibilitytimer] && !thing->player->kartstuff[k_invincibilitytimer]) P_DamageMobj(thing, tmthing, tmthing, 1); else if (thing->player->kartstuff[k_invincibilitytimer] && !tmthing->player->kartstuff[k_invincibilitytimer]) @@ -1440,7 +1437,7 @@ static boolean PIT_CheckThing(mobj_t *thing) if (thing->player) { // Doesn't matter what gravity player's following! Just do your stuff in YOUR direction only - if (tmthing->eflags & MFE_VERTICALFLIP + /*if (tmthing->eflags & MFE_VERTICALFLIP && (tmthing->z + tmthing->height + tmthing->momz < thing->z || tmthing->z + tmthing->height + tmthing->momz >= thing->z + thing->height)) ; @@ -1462,7 +1459,7 @@ static boolean PIT_CheckThing(mobj_t *thing) // The tmthing->target allows the pusher of the object // to get the point if he topples it on an opponent. } - } + }*/ if (tmthing->type == MT_FAN || tmthing->type == MT_STEAM) P_DoFanAndGasJet(tmthing, thing); @@ -1585,9 +1582,9 @@ static boolean PIT_CheckThing(mobj_t *thing) ; // Fix a few nasty spring-jumping bugs that happen sometimes. // Monitors are not treated as solid to players who are jumping, spinning or gliding, // unless it's a CTF team monitor and you're on the wrong team - else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) + /*else if (thing->flags & MF_MONITOR && tmthing->player && tmthing->player->pflags & (PF_JUMPED|PF_SPINNING|PF_GLIDING) && !((thing->type == MT_REDRINGBOX && tmthing->player->ctfteam != 1) || (thing->type == MT_BLUERINGBOX && tmthing->player->ctfteam != 2))) - ; + ;*/ // z checking at last // Treat noclip things as non-solid! else if ((thing->flags & (MF_SOLID|MF_NOCLIP)) == MF_SOLID diff --git a/src/p_mobj.c b/src/p_mobj.c index d22d5cb61..deeb737d8 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -495,7 +495,7 @@ boolean P_WeaponOrPanel(mobjtype_t type) // // Power Stone emerald management // -void P_EmeraldManager(void) +/*void P_EmeraldManager(void) { thinker_t *think; mobj_t *mo; @@ -664,7 +664,7 @@ void P_EmeraldManager(void) break; } } -} +}*/ // // P_ExplodeMissile diff --git a/src/p_setup.c b/src/p_setup.c index 6c7b6e927..98be24805 100644 --- a/src/p_setup.c +++ b/src/p_setup.c @@ -2865,7 +2865,6 @@ boolean P_SetupLevel(boolean skipprecip) if (players[i].starposttime) { G_SpawnPlayer(i, true); - P_ClearStarPost(players[i].starpostnum); } else G_SpawnPlayer(i, false); diff --git a/src/p_spec.c b/src/p_spec.c index 17cd1f886..bce18999b 100644 --- a/src/p_spec.c +++ b/src/p_spec.c @@ -1707,16 +1707,16 @@ boolean P_RunTriggerLinedef(line_t *triggerline, mobj_t *actor, sector_t *caller if (actor && actor->player && triggerline->flags & ML_EFFECT4) { - if (maptol & TOL_NIGHTS) + /*if (maptol & TOL_NIGHTS) lap = actor->player->mare; - else + else*/ lap = actor->player->laps; } else { - if (maptol & TOL_NIGHTS) + /*if (maptol & TOL_NIGHTS) lap = P_FindLowestMare(); - else + else*/ lap = P_FindLowestLap(); } @@ -4252,7 +4252,6 @@ DoneSection2: // //player->starpostangle = player->starposttime = player->starpostnum = 0; //player->starpostx = player->starposty = player->starpostz = 0; - P_ResetStarposts(); // Play the starpost sound for 'consistency' // S_StartSound(player->mo, sfx_strpst); diff --git a/src/p_telept.c b/src/p_telept.c index 695736403..89a28ddce 100644 --- a/src/p_telept.c +++ b/src/p_telept.c @@ -96,10 +96,6 @@ void P_MixUp(mobj_t *thing, fixed_t x, fixed_t y, fixed_t z, angle_t angle, thing->player->starpostangle = starpostangle; thing->player->starpostnum = starpostnum; - // Reset map starposts for the player's new info. - P_ResetStarposts(); - P_ClearStarPost(starpostnum); - P_ResetPlayer(thing->player); P_SetPlayerMobjState(thing, S_KART_STND1); // SRB2kart - was S_PLAY_STND diff --git a/src/p_tick.c b/src/p_tick.c index 3c5ed0b9e..bbb90f639 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -310,7 +310,7 @@ static inline void P_RunThinkers(void) // // Determine if the teams are unbalanced, and if so, move a player to the other team. // -static void P_DoAutobalanceTeams(void) +/*static void P_DoAutobalanceTeams(void) { changeteam_union NetPacket; UINT16 usvalue; @@ -562,7 +562,7 @@ static inline void P_DoCTFStuff(void) if (cv_teamscramble.value && server) P_DoTeamscrambling(); } -} +}*/ // // P_Ticker @@ -612,11 +612,11 @@ void P_Ticker(boolean run) if (!demoplayback) // Don't increment if a demo is playing. totalplaytime++; - if (!useNightsSS && G_IsSpecialStage(gamemap)) + /*if (!useNightsSS && G_IsSpecialStage(gamemap)) P_DoSpecialStageStuff(); if (runemeraldmanager) - P_EmeraldManager(); // Power stone mode + P_EmeraldManager(); // Power stone mode*/ if (run) { @@ -633,7 +633,7 @@ void P_Ticker(boolean run) } // Run shield positioning - P_RunShields(); + //P_RunShields(); P_RunOverlays(); P_RunShadows(); @@ -648,11 +648,11 @@ void P_Ticker(boolean run) leveltime++; timeinmap++; - if (G_TagGametype()) + /*if (G_TagGametype()) P_DoTagStuff(); if (G_GametypeHasTeams()) - P_DoCTFStuff(); + P_DoCTFStuff();*/ if (run) { @@ -793,7 +793,7 @@ void P_PreTicker(INT32 frames) #endif // Run shield positioning - P_RunShields(); + //P_RunShields(); P_RunOverlays(); P_UpdateSpecials(); diff --git a/src/p_user.c b/src/p_user.c index d3407bd65..502670549 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -344,7 +344,7 @@ void P_ResetScore(player_t *player) // // Returns the lowest open mare available // -UINT8 P_FindLowestMare(void) +/*UINT8 P_FindLowestMare(void) { thinker_t *th; mobj_t *mo2; @@ -375,7 +375,7 @@ UINT8 P_FindLowestMare(void) CONS_Debug(DBG_NIGHTS, "Lowest mare found: %d\n", mare); return mare; -} +}*/ // // P_FindLowestLap @@ -438,7 +438,7 @@ UINT8 P_FindHighestLap(void) // (Finds the lowest mare # for capsules that have not been destroyed). // Returns true if successful, false if there is no other mare. // -boolean P_TransferToNextMare(player_t *player) +/*boolean P_TransferToNextMare(player_t *player) { thinker_t *th; mobj_t *mo2; @@ -759,7 +759,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) if (G_IsSpecialStage(gamemap)) { for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i]/* && players[i].pflags & PF_NIGHTSMODE*/) + if (playeringame[i]) total_rings += players[i].health-1; } @@ -782,10 +782,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) P_AddPlayerScore(&players[i], (players[i].health - 1) * 50); } - // Add score to leaderboards now - /*if (!(netgame||multiplayer) && P_IsLocalPlayer(&players[i])) - G_AddTempNightsRecords(players[i].marescore, leveltime - player->marebegunat, players[i].mare + 1);*/ - // transfer scores anyway players[i].mo->health = players[i].health = 1; @@ -803,10 +799,6 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) player->textvar = 4; // Score and grades player->finishedrings = (INT16)(player->health - 1); - // Add score to temp leaderboards - /*if (!(netgame||multiplayer) && P_IsLocalPlayer(player)) - G_AddTempNightsRecords(player->marescore, leveltime - player->marebegunat, (UINT8)(oldmare + 1));*/ - // Starting a new mare, transfer scores player->marebegunat = leveltime; @@ -824,7 +816,7 @@ void P_NightserizePlayer(player_t *player, INT32 nighttime) } player->pflags |= PF_NIGHTSMODE; -} +}*/ // // P_PlayerInPain @@ -4536,7 +4528,7 @@ INT32 P_GetPlayerControlDirection(player_t *player) } // Control scheme for 2d levels. -static void P_2dMovement(player_t *player) +/*static void P_2dMovement(player_t *player) { ticcmd_t *cmd; INT32 topspeed, acceleration, thrustfactor; @@ -4713,7 +4705,7 @@ static void P_2dMovement(player_t *player) else if (player->rmomx > -topspeed && cmd->sidemove < 0) P_Thrust(player->mo, movepushangle, movepushforward); } -} +}*/ //#define OLD_MOVEMENT_CODE 1 static void P_3dMovement(player_t *player) @@ -5004,7 +4996,7 @@ static void P_SpectatorMovement(player_t *player) // graphical indicator // for building/debugging // NiGHTS levels! -static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height) +/*static void P_ShootLine(mobj_t *source, mobj_t *dest, fixed_t height) { mobj_t *mo; INT32 i; @@ -5578,16 +5570,6 @@ static void P_DoNiGHTSCapsule(player_t *player) UINT8 em = P_GetNextEmerald(); tic_t lowest_time; - /*for (i = 0; i < MAXPLAYERS; i++) - { - if (!playeringame[i] || players[i].spectator || !players[i].mo || !players[i].mo->tracer) - continue; - - emmo = P_SpawnMobj(players[i].mo->x, players[i].mo->y, players[i].mo->z + players[i].mo->info->height, MT_GOTEMERALD); - P_SetTarget(&emmo->target, players[i].mo); - P_SetMobjState(emmo, mobjinfo[MT_GOTEMERALD].meleestate + em); - }*/ - if (player->mo->tracer) { // Only give it to ONE person, and THAT player has to get to the goal! @@ -5683,7 +5665,7 @@ static void P_NiGHTSMovement(player_t *player) boolean capsule = false; // NiGHTS special stages have a pseudo-shared timer, so check if ANYONE is feeding the capsule. for (i = 0; i < MAXPLAYERS; i++) - if (playeringame[i] /*&& players[i].pflags & PF_NIGHTSMODE*/ + if (playeringame[i] && (players[i].capsule && players[i].capsule->reactiontime)) capsule = true; if (!capsule @@ -6238,7 +6220,7 @@ static void P_NiGHTSMovement(player_t *player) if (objectplacing) OP_NightsObjectplace(player); -} +}*/ // May be used in future for CTF #if 0 @@ -6457,7 +6439,7 @@ void P_ElementalFireTrail(player_t *player) static void P_MovePlayer(player_t *player) { ticcmd_t *cmd; - INT32 i; + //INT32 i; fixed_t runspd; @@ -6532,7 +6514,7 @@ static void P_MovePlayer(player_t *player) } // Locate the capsule for this mare. - else if (maptol & TOL_NIGHTS) + /*else if (maptol & TOL_NIGHTS) { if (!player->capsule && !player->bonustime) { @@ -6585,15 +6567,15 @@ static void P_MovePlayer(player_t *player) P_DamageMobj(player->mo, NULL, NULL, 1); player->pflags &= ~PF_NIGHTSFALL; } - } + }*/ ////////////////////// // MOVEMENT CODE // ////////////////////// - if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. + /*if (twodlevel || player->mo->flags2 & MF2_TWOD) // 2d-level, so special control applies. P_2dMovement(player); - else + else*/ { if (!player->climbing && (!P_AnalogMove(player))) player->mo->angle = (cmd->angleturn<<16 /* not FRACBITS */); @@ -9441,8 +9423,8 @@ void P_PlayerThink(player_t *player) player->losstime--; // Flash player after being hit. - if (!(player->pflags & PF_NIGHTSMODE - || player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. + if (!(//player->pflags & PF_NIGHTSMODE || + player->kartstuff[k_hyudorotimer] // SRB2kart - fixes Hyudoro not flashing when it should. || player->kartstuff[k_growshrinktimer] > 0 // Grow doesn't flash either. || player->kartstuff[k_respawn] // Respawn timer (for drop dash effect) || (G_BattleGametype() && player->kartstuff[k_bumper] <= 0 && player->kartstuff[k_comebacktimer]) @@ -9454,13 +9436,13 @@ void P_PlayerThink(player_t *player) else player->mo->flags2 &= ~MF2_DONTDRAW; } - else if (player->mo->tracer) + /*else if (player->mo->tracer) { if (player->powers[pw_flashing] & 1) player->mo->tracer->flags2 |= MF2_DONTDRAW; else player->mo->tracer->flags2 &= ~MF2_DONTDRAW; - } + }*/ player->pflags &= ~PF_SLIDING; diff --git a/src/y_inter.c b/src/y_inter.c index e26d49737..3228f8a3d 100644 --- a/src/y_inter.c +++ b/src/y_inter.c @@ -560,13 +560,13 @@ void Y_Ticker(void) // Team scramble code for team match and CTF. // Don't do this if we're going to automatically scramble teams next round. - if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server) + /*if (G_GametypeHasTeams() && cv_teamscramble.value && !cv_scrambleonchange.value && server) { // If we run out of time in intermission, the beauty is that // the P_Ticker() team scramble code will pick it up. if ((intertic % (TICRATE/7)) == 0) P_DoTeamscrambling(); - } + }*/ // multiplayer uses timer (based on cv_inttime) if (timer) From 7032b2773ad87e7d22baea32f46ef26b44eb52c1 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:14:25 +0100 Subject: [PATCH 23/44] Complete the disabling of the traditional shield mechanism (oversight from initial commit). --- src/p_local.h | 2 +- src/p_mobj.c | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/p_local.h b/src/p_local.h index 30bf38511..5fd37248c 100644 --- a/src/p_local.h +++ b/src/p_local.h @@ -231,7 +231,7 @@ boolean P_MobjWasRemoved(mobj_t *th); void P_RemoveSavegameMobj(mobj_t *th); boolean P_SetPlayerMobjState(mobj_t *mobj, statenum_t state); boolean P_SetMobjState(mobj_t *mobj, statenum_t state); -void P_RunShields(void); +//void P_RunShields(void); void P_RunOverlays(void); void P_RunShadows(void); void P_MobjThinker(mobj_t *mobj); diff --git a/src/p_mobj.c b/src/p_mobj.c index deeb737d8..ed794b0f4 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6127,7 +6127,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return true; } -mobj_t *shields[MAXPLAYERS*2]; +/*mobj_t *shields[MAXPLAYERS*2]; INT32 numshields = 0; void P_RunShields(void) @@ -6175,7 +6175,7 @@ static boolean P_AddShield(mobj_t *thing) P_SetTarget(&shields[numshields++], thing); return true; -} +}*/ void P_RunOverlays(void) { @@ -6609,8 +6609,8 @@ void P_MobjThinker(mobj_t *mobj) P_RemoveMobj(mobj); return; } - else - P_AddOverlay(mobj); + + P_AddOverlay(mobj); break; case MT_SHADOW: if (!mobj->target) @@ -6618,10 +6618,10 @@ void P_MobjThinker(mobj_t *mobj) P_RemoveMobj(mobj); return; } - else - P_AddShadow(mobj); + + P_AddShadow(mobj); break; - case MT_BLACKORB: + /*case MT_BLACKORB: case MT_WHITEORB: case MT_GREENORB: case MT_YELLOWORB: @@ -6629,7 +6629,7 @@ void P_MobjThinker(mobj_t *mobj) case MT_PITYORB: if (!P_AddShield(mobj)) return; - break; + break;*/ //{ SRB2kart mobs case MT_ORBINAUT_SHIELD: // Kart orbit/trail items case MT_JAWZ_SHIELD: From 6691f3911756f4a22002e2ccec3ec5b7c26a8bb6 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:16:23 +0100 Subject: [PATCH 24/44] Incorrect comment starting location. --- src/p_mobj.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/p_mobj.c b/src/p_mobj.c index ed794b0f4..b0aba1ec9 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -6059,7 +6059,7 @@ static void P_NightsItemChase(mobj_t *thing) P_Attract(thing, thing->tracer, true); } -static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) +/*static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) { if (!thing->target || thing->target->health <= 0 || !thing->target->player || (thing->target->player->powers[pw_shield] & SH_NOSTACK) == SH_NONE || thing->target->player->powers[pw_super] @@ -6127,7 +6127,7 @@ static boolean P_ShieldLook(mobj_t *thing, shieldtype_t shield) return true; } -/*mobj_t *shields[MAXPLAYERS*2]; +mobj_t *shields[MAXPLAYERS*2]; INT32 numshields = 0; void P_RunShields(void) From cdc6a87ada3bdb2f2ed22b62bae32eac9b6a2862 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 17:26:56 +0100 Subject: [PATCH 25/44] Improve A_MineExplode. * Re-order the conditions within it such that it quickly checks for shootability and absence of scenery BEFORE it performs the more costly range or parentage checks. * Make its explosion radius take mapscale into account. (This is the only off-topic change made in this branch. I have made it here because half of this commit, which doing the other half in a seperate branch would conflict with, is on-topic.) --- src/p_enemy.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 7cdc354de..8073a2c24 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -8247,12 +8247,14 @@ void A_MineExplode(mobj_t *actor) INT32 d; INT32 locvar1 = var1; mobjtype_t type; + fixed_t range; #ifdef HAVE_BLUA if (LUA_CallAction("A_MineExplode", actor)) return; #endif type = (mobjtype_t)locvar1; + range = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); for (th = thinkercap.next; th != &thinkercap; th = th->next) { @@ -8267,27 +8269,25 @@ void A_MineExplode(mobj_t *actor) if (mo2 == actor || mo2->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop! continue; + if (!(mo2->flags & MF_SHOOTABLE) || (mo2->flags & MF_SCENERY)) + continue; + if (G_BattleGametype() && actor->target && actor->target->player && actor->target->player->kartstuff[k_bumper] <= 0 && mo2 == actor->target) continue; - if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > actor->info->painchance) + if (P_AproxDistance(P_AproxDistance(mo2->x - actor->x, mo2->y - actor->y), mo2->z - actor->z) > range) continue; - if ((mo2->flags & MF_SHOOTABLE) && !(mo2->flags & MF_SCENERY)) - { - actor->flags2 |= MF2_DEBRIS; + actor->flags2 |= MF2_DEBRIS; - if (mo2->player) // Looks like we're going to have to need a seperate function for this too - K_ExplodePlayer(mo2->player, actor->target); - else - P_DamageMobj(mo2, actor, actor->target, 1); - - continue; - } + if (mo2->player) // Looks like we're going to have to need a seperate function for this too + K_ExplodePlayer(mo2->player, actor->target); + else + P_DamageMobj(mo2, actor, actor->target, 1); } for (d = 0; d < 16; d++) - K_SpawnKartExplosion(actor->x, actor->y, actor->z, actor->info->painchance + 32*FRACUNIT, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 + K_SpawnKartExplosion(actor->x, actor->y, actor->z, range + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 if (actor->target && actor->target->player) K_SpawnMineExplosion(actor, actor->target->player->skincolor); From bfd88c59c64317a62c1c89c21e9313d4e8e7c8dc Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Wed, 3 Oct 2018 20:09:32 +0200 Subject: [PATCH 26/44] Allow client to open chat and scroll even if muted. --- src/hu_stuff.c | 59 +++++++++++++++++++++++++++++++++----------------- src/hu_stuff.h | 2 ++ 2 files changed, 41 insertions(+), 20 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 67a656455..255d8512b 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -435,7 +435,7 @@ static void DoSayCommand(SINT8 target, size_t usedargs, UINT8 flags) numwords = COM_Argc() - usedargs; I_Assert(numwords > 0); - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // TODO: Per Player mute. + if (CHAT_MUTE) // TODO: Per Player mute. { HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); return; @@ -962,7 +962,7 @@ static void HU_queueChatChar(INT32 c) c_input = 0; // last minute mute check - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + if (CHAT_MUTE) { HU_AddChatText(va("%s>ERROR: The chat is muted. You can't say anything.", "\x85")); return; @@ -1055,20 +1055,20 @@ static boolean justscrolledup; boolean HU_Responder(event_t *ev) { INT32 c=0; - + if (ev->type != ev_keydown) return false; // only KeyDown events now... - + if (!chat_on) { // enter chat mode if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) - && netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) + && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise. { - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - return false; + //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + // return false; chat_on = true; w_chat[0] = 0; teamtalk = false; @@ -1076,10 +1076,10 @@ boolean HU_Responder(event_t *ev) return true; } if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) - && netgame && (!cv_mute.value || server || (IsPlayerAdmin(consoleplayer)))) + && netgame && !OLD_MUTE) { - if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - return false; + //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) + // return false; chat_on = true; w_chat[0] = 0; teamtalk = false; // CHANGE THIS TO TRUE TO MAKE SAYTEAM WORK AGAIN @@ -1090,7 +1090,7 @@ boolean HU_Responder(event_t *ev) } else // if chat_on { - + // Ignore modifier keys // Note that we do this here so users can still set // their chat keys to one of these, if they so desire. @@ -1118,7 +1118,7 @@ boolean HU_Responder(event_t *ev) // TODO: make chat behave like the console, so that we can go back and edit stuff when we fuck up. // pasting. pasting is cool. chat is a bit limited, though :( - if ((c == 'v' || c == 'V') && ctrldown) + if (((c == 'v' || c == 'V') && ctrldown) && !CHAT_MUTE) { const char *paste = I_ClipboardPaste(); @@ -1158,7 +1158,7 @@ boolean HU_Responder(event_t *ev) } } - if (HU_keyInChatString(w_chat,c)) + if (!CHAT_MUTE && HU_keyInChatString(w_chat,c)) { HU_queueChatChar(c); } @@ -1173,21 +1173,21 @@ boolean HU_Responder(event_t *ev) chat_on = false; c_input = 0; // reset input cursor } - else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0) // CHAT SCROLLING YAYS! + else if ((c == KEY_UPARROW || c == KEY_MOUSEWHEELUP) && chat_scroll > 0 && !OLDCHAT) // CHAT SCROLLING YAYS! { chat_scroll--; justscrolledup = true; chat_scrolltime = 4; } - else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0) + else if ((c == KEY_DOWNARROW || c == KEY_MOUSEWHEELDOWN) && chat_scroll < chat_maxscroll && chat_maxscroll > 0 && !OLDCHAT) { chat_scroll++; justscrolleddown = true; chat_scrolltime = 4; } - else if (c == KEY_LEFTARROW && c_input != 0) // i said go back + else if (c == KEY_LEFTARROW && c_input != 0 && !OLDCHAT) // i said go back c_input--; - else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat)) + else if (c == KEY_RIGHTARROW && c_input < strlen(w_chat) && !OLDCHAT) // don't need to check for admin or w/e here since the chat won't ever contain anything if it's muted. c_input++; return true; } @@ -1498,8 +1498,10 @@ static void HU_DrawChat(void) INT32 charwidth = 4, charheight = 6; INT32 t = 0, c = 0, y = chaty - (typelines*charheight) - (cv_kartspeedometer.value ? 16 : 0); UINT32 i = 0, saylen = strlen(w_chat); // You learn new things everyday! + INT32 cflag = 0; const char *ntalk = "Say: ", *ttalk = "Team: "; const char *talk = ntalk; + const char *mute = "Chat has been muted."; if (teamtalk) { @@ -1511,7 +1513,14 @@ static void HU_DrawChat(void) t = 0x400; // Blue #endif } - + + if (CHAT_MUTE) + { + talk = mute; + typelines = 1; + cflag = V_GRAYMAP; // set text in gray if chat is muted. + } + V_DrawFillConsoleMap(chatx, y-1, cv_chatwidth.value, (typelines*charheight), 239 | V_SNAPTOBOTTOM | V_SNAPTOLEFT); while (talk[i]) @@ -1519,11 +1528,21 @@ static void HU_DrawChat(void) if (talk[i] < HU_FONTSTART) ++i; else - V_DrawChatCharacter(chatx + c + 2, y, talk[i++] |V_SNAPTOBOTTOM|V_SNAPTOLEFT, !cv_allcaps.value, NULL); + { + V_DrawChatCharacter(chatx + c + 2, y, talk[i] |V_SNAPTOBOTTOM|V_SNAPTOLEFT|cflag, !cv_allcaps.value, V_GetStringColormap(talk[i]|cflag)); + i++; + } c += charwidth; } - + + // if chat is muted, just draw the log and get it over with: + if (CHAT_MUTE) + { + HU_drawChatLog(0); + return; + } + i = 0; typelines = 1; diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 90ffeb429..28a31d4be 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -81,6 +81,8 @@ extern patch_t *iconprefix[MAXSKINS]; #define CHAT_BUFSIZE 64 // that's enough messages, right? We'll delete the older ones when that gets out of hand. #define OLDCHAT (cv_consolechat.value || dedicated || vid.width < 640) +#define CHAT_MUTE (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this still allows to open the chat but not to type. That's used for scrolling and whatnot. +#define OLD_MUTE (OLDCHAT && cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) // this is used to prevent oldchat from opening when muted. // some functions void HU_AddChatText(const char *text); From 9e2e7e553d81fad629edabd0b586bd1a49bc1b82 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 20:23:59 +0100 Subject: [PATCH 27/44] Update A_GrenadeRing to also take the mapheader scale into account. --- src/p_enemy.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 8073a2c24..28dcf7b95 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3913,6 +3913,7 @@ void A_ThrownRing(mobj_t *actor) //{ SRB2kart - A_GRENADERING static mobj_t *grenade; +static fixed_t explodedist; static inline boolean PIT_GrenadeRing(mobj_t *thing) { @@ -3935,9 +3936,9 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) return true; // see if it went over / under - if (grenade->z - grenade->info->painchance > thing->z + thing->height) + if (grenade->z - explodedist > thing->z + thing->height) return true; // overhead - if (grenade->z + grenade->height + grenade->info->painchance < thing->z) + if (grenade->z + grenade->height + explodedist < thing->z) return true; // underneath if (netgame && thing->player && thing->player->spectator) @@ -3950,7 +3951,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) } if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), - thing->z - grenade->z) > grenade->info->painchance) + thing->z - grenade->z) > explodedist) return true; // Too far away // Explode! @@ -3961,7 +3962,7 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) void A_GrenadeRing(mobj_t *actor) { INT32 bx, by, xl, xh, yl, yh; - const fixed_t explodedist = actor->info->painchance; + explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); if (leveltime % 35 == 0) S_StartSound(actor, actor->info->activesound); From e94465689edf3cfa5d7be80444a1c28a499853b0 Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 20:51:15 +0100 Subject: [PATCH 28/44] * Modify PIT_GrenadeRing to place less-complicated checks near the start of the function. * Add the customary LUA_CallAction call to A_GrenadeRing. * Revamp A_MineExplode into using a blockmap iterator. Having tested it it might be less laggy in some situations, but I think the drawing is causing the bulk of the problems here. --- src/p_enemy.c | 101 ++++++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 90 insertions(+), 11 deletions(-) diff --git a/src/p_enemy.c b/src/p_enemy.c index 28dcf7b95..001b9e547 100644 --- a/src/p_enemy.c +++ b/src/p_enemy.c @@ -3918,11 +3918,20 @@ static fixed_t explodedist; static inline boolean PIT_GrenadeRing(mobj_t *thing) { if (!grenade) - return true; + return false; if (thing->type != MT_PLAYER) // Don't explode for anything but an actual player. return true; + if (!(thing->flags & MF_SHOOTABLE)) + { + // didn't do any damage + return true; + } + + if (netgame && thing->player && thing->player->spectator) + return true; + if (thing == grenade->target && grenade->threshold != 0) // Don't blow up at your owner. return true; @@ -3941,15 +3950,6 @@ static inline boolean PIT_GrenadeRing(mobj_t *thing) if (grenade->z + grenade->height + explodedist < thing->z) return true; // underneath - if (netgame && thing->player && thing->player->spectator) - return true; - - if (!(thing->flags & MF_SHOOTABLE)) - { - // didn't do any damage - return true; - } - if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), thing->z - grenade->z) > explodedist) return true; // Too far away @@ -3963,6 +3963,10 @@ void A_GrenadeRing(mobj_t *actor) { INT32 bx, by, xl, xh, yl, yh; explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); +#ifdef HAVE_BLUA + if (LUA_CallAction("A_GrenadeRing", actor)) + return; +#endif if (leveltime % 35 == 0) S_StartSound(actor, actor->info->activesound); @@ -3979,6 +3983,80 @@ void A_GrenadeRing(mobj_t *actor) for (bx = xl; bx <= xh; bx++) P_BlockThingsIterator(bx, by, PIT_GrenadeRing); } + +static inline boolean PIT_MineExplode(mobj_t *thing) +{ + if (!grenade || P_MobjWasRemoved(grenade)) + return false; // There's the possibility these can chain react onto themselves after they've already died if there are enough all in one spot + + if (thing == grenade || thing->type == MT_MINEEXPLOSIONSOUND) // Don't explode yourself! Endless loop! + return true; + + if (!(thing->flags & MF_SHOOTABLE) || (thing->flags & MF_SCENERY)) + return true; + + if (netgame && thing->player && thing->player->spectator) + return true; + + if (G_BattleGametype() && grenade->target && grenade->target->player && grenade->target->player->kartstuff[k_bumper] <= 0 && thing == grenade->target) + return true; + + // see if it went over / under + if (grenade->z - explodedist > thing->z + thing->height) + return true; // overhead + if (grenade->z + grenade->height + explodedist < thing->z) + return true; // underneath + + if (P_AproxDistance(P_AproxDistance(thing->x - grenade->x, thing->y - grenade->y), + thing->z - grenade->z) > explodedist) + return true; // Too far away + + grenade->flags2 |= MF2_DEBRIS; + + if (thing->player) // Looks like we're going to have to need a seperate function for this too + K_ExplodePlayer(thing->player, grenade->target); + else + P_DamageMobj(thing, grenade, grenade->target, 1); + + return true; +} + +void A_MineExplode(mobj_t *actor) +{ + INT32 bx, by, xl, xh, yl, yh; + explodedist = FixedMul(actor->info->painchance, mapheaderinfo[gamemap-1]->mobj_scale); + INT32 d; + INT32 locvar1 = var1; + mobjtype_t type; +#ifdef HAVE_BLUA + if (LUA_CallAction("A_MineExplode", actor)) + return; +#endif + + type = (mobjtype_t)locvar1; + + // Use blockmap to check for nearby shootables + yh = (unsigned)(actor->y + explodedist - bmaporgy)>>MAPBLOCKSHIFT; + yl = (unsigned)(actor->y - explodedist - bmaporgy)>>MAPBLOCKSHIFT; + xh = (unsigned)(actor->x + explodedist - bmaporgx)>>MAPBLOCKSHIFT; + xl = (unsigned)(actor->x - explodedist - bmaporgx)>>MAPBLOCKSHIFT; + + grenade = actor; + + for (by = yl; by <= yh; by++) + for (bx = xl; bx <= xh; bx++) + P_BlockThingsIterator(bx, by, PIT_MineExplode); + + for (d = 0; d < 16; d++) + K_SpawnKartExplosion(actor->x, actor->y, actor->z, explodedist + 32*mapheaderinfo[gamemap-1]->mobj_scale, 32, type, d*(ANGLE_45/4), true, false, actor->target); // 32 <-> 64 + + if (actor->target && actor->target->player) + K_SpawnMineExplosion(actor, actor->target->player->skincolor); + else + K_SpawnMineExplosion(actor, SKINCOLOR_RED); + + P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND); +} //} // Function: A_SetSolidSteam @@ -8241,6 +8319,7 @@ void A_JawzExplode(mobj_t *actor) return; } +/* old A_MineExplode - see elsewhere in the file void A_MineExplode(mobj_t *actor) { mobj_t *mo2; @@ -8298,7 +8377,7 @@ void A_MineExplode(mobj_t *actor) P_SpawnMobj(actor->x, actor->y, actor->z, MT_MINEEXPLOSIONSOUND); return; -} +}*/ void A_BallhogExplode(mobj_t *actor) { From 304b8b343e160765b590536c0a0fa72168a4c2ba Mon Sep 17 00:00:00 2001 From: toaster Date: Wed, 3 Oct 2018 20:56:43 +0100 Subject: [PATCH 29/44] Don't have all of your mines disappear into the aether if you have to shield-drop ONE, because they're not all out at once. (This is only really relevant to debug testing, given picking up additional HUD-dropped mines isn't very likely. --- src/k_kart.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index db3178035..823cbf97d 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -3140,7 +3140,7 @@ void K_DropHnextList(player_t *player) mobj_t *work = player->mo, *nextwork, *dropwork; INT32 flip; mobjtype_t type; - boolean orbit, ponground; + boolean orbit, ponground, dropall = true; if (!work) return; @@ -3180,6 +3180,7 @@ void K_DropHnextList(player_t *player) break; case MT_SSMINE_SHIELD: orbit = false; + dropall = false; type = MT_SSMINE; break; case MT_FAKESHIELD: @@ -3258,7 +3259,8 @@ void K_DropHnextList(player_t *player) player->kartstuff[k_bananadrag] = 0; if (player->kartstuff[k_eggmanheld]) player->kartstuff[k_eggmanheld] = 0; - else if (player->kartstuff[k_itemheld]) + else if (player->kartstuff[k_itemheld] + && (dropall || (--player->kartstuff[k_itemamount] <= 0))) { player->kartstuff[k_itemamount] = player->kartstuff[k_itemheld] = 0; player->kartstuff[k_itemtype] = KITEM_NONE; From c99d9e7253540eecb6a46e762e41f6d22b45621f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 3 Oct 2018 20:48:44 -0400 Subject: [PATCH 30/44] Edit Pink, Navy, and Jet --- src/k_kart.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/k_kart.c b/src/k_kart.c index db3178035..00cb29a9f 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -189,7 +189,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { { 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}, // SKINCOLOR_BROWN { 51, 52, 53, 55, 56, 57, 58, 60, 61, 63, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_LEATHER {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON - {121, 121, 144, 144, 145, 145, 146, 146, 147, 148, 149, 150, 151, 134, 136, 138}, // SKINCOLOR_PINK + {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED @@ -228,10 +228,10 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN {120, 120, 208, 209, 210, 226, 215, 216, 217, 229, 229, 205, 205, 206, 207, 31}, // SKINCOLOR_JAWZ {208, 209, 211, 213, 215, 216, 216, 217, 217, 218, 218, 219, 205, 206, 207, 207}, // SKINCOLOR_CERULEAN - {215, 215, 215, 216, 216, 217, 218, 204, 204, 205, 205, 206, 207, 29, 30, 31}, // SKINCOLOR_NAVY + {211, 212, 213, 215, 216, 218, 219, 205, 206, 206, 207, 207, 28, 29, 30, 31}, // SKINCOLOR_NAVY {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL - {200, 201, 202, 203, 204, 205, 206, 207, 28, 28, 29, 29, 30, 30, 31, 31}, // SKINCOLOR_JET + {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE From d65b02b176d923f661562db4b15a0246934f9496 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Wed, 3 Oct 2018 21:18:07 -0400 Subject: [PATCH 31/44] Moved colors around yet again for nicer invincibility effect - Ruby is closer to the pinks (and where purples would be if it wrapped around) - Sapphire is closer to the cyans - Dream is right before the teals --- src/dehacked.c | 32 +++++++++++------------ src/doomdef.h | 6 ++--- src/k_kart.c | 70 +++++++++++++++++++++++++------------------------- 3 files changed, 54 insertions(+), 54 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 99d952596..baa35b748 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -7613,9 +7613,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SALMON", // 10 // SKINCOLOR_SALMON "PINK", // 11 // SKINCOLOR_PINK "ROSE", // 12 // SKINCOLOR_ROSE - "RASPBERRY", // 13 // SKINCOLOR_RASPBERRY - "RED", // 14 // SKINCOLOR_RED - "RUBY", // 15 // SKINCOLOR_RUBY + "RUBY", // 13 // SKINCOLOR_RUBY + "RASPBERRY", // 14 // SKINCOLOR_RASPBERRY + "RED", // 15 // SKINCOLOR_RED "CRIMSON", // 16 // SKINCOLOR_CRIMSON "KETCHUP", // 17 // SKINCOLOR_KETCHUP "DAWN", // 18 // SKINCOLOR_DAWN @@ -7635,16 +7635,16 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "VOMIT", // 32 // SKINCOLOR_VOMIT "GARDEN", // 33 // SKINCOLOR_GARDEN "LIME", // 34 // SKINCOLOR_LIME - "DREAM", // 35 // SKINCOLOR_DREAM - "TEA", // 36 // SKINCOLOR_TEA - "PISTACHIO", // 37 // SKINCOLOR_PISTACHIO - "ROBOHOOD", // 38 // SKINCOLOR_ROBOHOOD - "MOSS", // 39 // SKINCOLOR_MOSS - "MINT", // 40 // SKINCOLOR_MINT - "GREEN", // 41 // SKINCOLOR_GREEN - "PINETREE", // 42 // SKINCOLOR_PINETREE - "EMERALD", // 43 // SKINCOLOR_EMERALD - "SWAMP", // 44 // SKINCOLOR_SWAMP + "TEA", // 35 // SKINCOLOR_TEA + "PISTACHIO", // 36 // SKINCOLOR_PISTACHIO + "ROBOHOOD", // 37 // SKINCOLOR_ROBOHOOD + "MOSS", // 38 // SKINCOLOR_MOSS + "MINT", // 39 // SKINCOLOR_MINT + "GREEN", // 40 // SKINCOLOR_GREEN + "PINETREE", // 41 // SKINCOLOR_PINETREE + "EMERALD", // 42 // SKINCOLOR_EMERALD + "SWAMP", // 43 // SKINCOLOR_SWAMP + "DREAM", // 44 // SKINCOLOR_DREAM "AQUA", // 45 // SKINCOLOR_AQUA "TEAL", // 46 // SKINCOLOR_TEAL "CYAN", // 47 // SKINCOLOR_CYAN @@ -7654,9 +7654,9 @@ static const char *COLOR_ENUMS[] = { // Rejigged for Kart. "SLATE", // 51 // SKINCOLOR_SLATE "STEEL", // 52 // SKINCOLOR_STEEL "JET", // 53 // SKINCOLOR_JET - "PERIWINKLE", // 54 // SKINCOLOR_PERIWINKLE - "BLUE", // 55 // SKINCOLOR_BLUE - "SAPPHIRE", // 56 // SKINCOLOR_SAPPHIRE + "SAPPHIRE", // 54 // SKINCOLOR_SAPPHIRE + "PERIWINKLE", // 55 // SKINCOLOR_PERIWINKLE + "BLUE", // 56 // SKINCOLOR_BLUE "BLUEBERRY", // 57 // SKINCOLOR_BLUEBERRY "DUSK", // 58 // SKINCOLOR_DUSK "PURPLE", // 59 // SKINCOLOR_PURPLE diff --git a/src/doomdef.h b/src/doomdef.h index b5519f6fd..c051a58b1 100644 --- a/src/doomdef.h +++ b/src/doomdef.h @@ -244,9 +244,9 @@ typedef enum SKINCOLOR_SALMON, SKINCOLOR_PINK, SKINCOLOR_ROSE, + SKINCOLOR_RUBY, SKINCOLOR_RASPBERRY, SKINCOLOR_RED, - SKINCOLOR_RUBY, SKINCOLOR_CRIMSON, SKINCOLOR_KETCHUP, SKINCOLOR_DAWN, @@ -266,7 +266,6 @@ typedef enum SKINCOLOR_VOMIT, SKINCOLOR_GARDEN, SKINCOLOR_LIME, - SKINCOLOR_DREAM, SKINCOLOR_TEA, SKINCOLOR_PISTACHIO, SKINCOLOR_ROBOHOOD, @@ -276,6 +275,7 @@ typedef enum SKINCOLOR_PINETREE, SKINCOLOR_EMERALD, SKINCOLOR_SWAMP, + SKINCOLOR_DREAM, SKINCOLOR_AQUA, SKINCOLOR_TEAL, SKINCOLOR_CYAN, @@ -285,9 +285,9 @@ typedef enum SKINCOLOR_SLATE, SKINCOLOR_STEEL, SKINCOLOR_JET, + SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl SKINCOLOR_PERIWINKLE, SKINCOLOR_BLUE, - SKINCOLOR_SAPPHIRE, // sweet mother, i cannot weave – slender aphrodite has overcome me with longing for a girl SKINCOLOR_BLUEBERRY, SKINCOLOR_DUSK, SKINCOLOR_PURPLE, diff --git a/src/k_kart.c b/src/k_kart.c index 00cb29a9f..bed5a86ec 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -55,9 +55,9 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Salmon", // 10 // SKINCOLOR_SALMON "Pink", // 11 // SKINCOLOR_PINK "Rose", // 12 // SKINCOLOR_ROSE - "Raspberry", // 13 // SKINCOLOR_RASPBERRY - "Red", // 14 // SKINCOLOR_RED - "Ruby", // 15 // SKINCOLOR_RUBY + "Ruby", // 13 // SKINCOLOR_RUBY + "Raspberry", // 14 // SKINCOLOR_RASPBERRY + "Red", // 15 // SKINCOLOR_RED "Crimson", // 16 // SKINCOLOR_CRIMSON "Ketchup", // 17 // SKINCOLOR_KETCHUP "Dawn", // 18 // SKINCOLOR_DAWN @@ -77,16 +77,16 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Vomit", // 32 // SKINCOLOR_VOMIT "Garden", // 33 // SKINCOLOR_GARDEN "Lime", // 34 // SKINCOLOR_LIME - "Dream", // 35 // SKINCOLOR_DREAM - "Tea", // 36 // SKINCOLOR_TEA - "Pistachio", // 37 // SKINCOLOR_PISTACHIO - "Robo-Hood", // 38 // SKINCOLOR_ROBOHOOD - "Moss", // 39 // SKINCOLOR_MOSS - "Mint", // 40 // SKINCOLOR_MINT - "Green", // 41 // SKINCOLOR_GREEN - "Pinetree", // 42 // SKINCOLOR_PINETREE - "Emerald", // 43 // SKINCOLOR_EMERALD - "Swamp", // 44 // SKINCOLOR_SWAMP + "Tea", // 35 // SKINCOLOR_TEA + "Pistachio", // 36 // SKINCOLOR_PISTACHIO + "Robo-Hood", // 37 // SKINCOLOR_ROBOHOOD + "Moss", // 38 // SKINCOLOR_MOSS + "Mint", // 39 // SKINCOLOR_MINT + "Green", // 40 // SKINCOLOR_GREEN + "Pinetree", // 41 // SKINCOLOR_PINETREE + "Emerald", // 42 // SKINCOLOR_EMERALD + "Swamp", // 43 // SKINCOLOR_SWAMP + "Dream", // 44 // SKINCOLOR_DREAM "Aqua", // 45 // SKINCOLOR_AQUA "Teal", // 46 // SKINCOLOR_TEAL "Cyan", // 47 // SKINCOLOR_CYAN @@ -96,9 +96,9 @@ const char *KartColor_Names[MAXSKINCOLORS] = "Slate", // 51 // SKINCOLOR_SLATE "Steel", // 52 // SKINCOLOR_STEEL "Jet", // 53 // SKINCOLOR_JET - "Periwinkle", // 54 // SKINCOLOR_PERIWINKLE - "Blue", // 55 // SKINCOLOR_BLUE - "Sapphire", // 56 // SKINCOLOR_SAPPHIRE + "Sapphire", // 54 // SKINCOLOR_SAPPHIRE + "Periwinkle", // 55 // SKINCOLOR_PERIWINKLE + "Blue", // 56 // SKINCOLOR_BLUE "Blueberry", // 57 // SKINCOLOR_BLUEBERRY "Dusk", // 58 // SKINCOLOR_DUSK "Purple", // 59 // SKINCOLOR_PURPLE @@ -124,9 +124,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_TEA,8, // 10 // SKINCOLOR_SALMON SKINCOLOR_PISTACHIO,8, // 11 // SKINCOLOR_PINK SKINCOLOR_MOSS,8, // 12 // SKINCOLOR_ROSE - SKINCOLOR_MINT,8, // 13 // SKINCOLOR_RASPBERRY - SKINCOLOR_GREEN,6, // 14 // SKINCOLOR_RED - SKINCOLOR_SAPPHIRE,8, // 15 // SKINCOLOR_RUBY + SKINCOLOR_SAPPHIRE,8, // 13 // SKINCOLOR_RUBY + SKINCOLOR_MINT,8, // 14 // SKINCOLOR_RASPBERRY + SKINCOLOR_GREEN,6, // 15 // SKINCOLOR_RED SKINCOLOR_PINETREE,6, // 16 // SKINCOLOR_CRIMSON SKINCOLOR_MUSTARD,10, // 17 // SKINCOLOR_KETCHUP SKINCOLOR_DUSK,8, // 18 // SKINCOLOR_DAWN @@ -146,16 +146,16 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_ROBOHOOD,8, // 32 // SKINCOLOR_VOMIT SKINCOLOR_LAVENDER,6, // 33 // SKINCOLOR_GARDEN SKINCOLOR_TANGERINE,8, // 34 // SKINCOLOR_LIME - SKINCOLOR_POMEGRANATE,8, // 35 // SKINCOLOR_DREAM - SKINCOLOR_SALMON,8, // 36 // SKINCOLOR_TEA - SKINCOLOR_PINK,6, // 37 // SKINCOLOR_PISTACHIO - SKINCOLOR_VOMIT,8, // 38 // SKINCOLOR_ROBOHOOD - SKINCOLOR_ROSE,8, // 39 // SKINCOLOR_MOSS - SKINCOLOR_RASPBERRY,8, // 40 // SKINCOLOR_MINT - SKINCOLOR_RED,8, // 41 // SKINCOLOR_GREEN - SKINCOLOR_CRIMSON,8, // 42 // SKINCOLOR_PINETREE - SKINCOLOR_PURPLE,8, // 43 // SKINCOLOR_EMERALD - SKINCOLOR_BYZANTIUM,8, // 44 // SKINCOLOR_SWAMP + SKINCOLOR_SALMON,8, // 35 // SKINCOLOR_TEA + SKINCOLOR_PINK,6, // 36 // SKINCOLOR_PISTACHIO + SKINCOLOR_VOMIT,8, // 37 // SKINCOLOR_ROBOHOOD + SKINCOLOR_ROSE,8, // 38 // SKINCOLOR_MOSS + SKINCOLOR_RASPBERRY,8, // 39 // SKINCOLOR_MINT + SKINCOLOR_RED,8, // 40 // SKINCOLOR_GREEN + SKINCOLOR_CRIMSON,8, // 41 // SKINCOLOR_PINETREE + SKINCOLOR_PURPLE,8, // 42 // SKINCOLOR_EMERALD + SKINCOLOR_BYZANTIUM,8, // 43 // SKINCOLOR_SWAMP + SKINCOLOR_POMEGRANATE,8, // 44 // SKINCOLOR_DREAM SKINCOLOR_YELLOW,8, // 45 // SKINCOLOR_AQUA SKINCOLOR_OLIVE,8, // 46 // SKINCOLOR_TEAL SKINCOLOR_PEACH,8, // 47 // SKINCOLOR_CYAN @@ -165,9 +165,9 @@ const UINT8 KartColor_Opposite[MAXSKINCOLORS*2] = SKINCOLOR_GOLD,10, // 51 // SKINCOLOR_SLATE SKINCOLOR_BRONZE,10, // 52 // SKINCOLOR_STEEL SKINCOLOR_BURGUNDY,8, // 53 // SKINCOLOR_JET - SKINCOLOR_CREAMSICLE,8, // 54 // SKINCOLOR_PERIWINKLE - SKINCOLOR_ORANGE,8, // 55 // SKINCOLOR_BLUE - SKINCOLOR_RUBY,6, // 56 // SKINCOLOR_SAPPHIRE + SKINCOLOR_RUBY,6, // 54 // SKINCOLOR_SAPPHIRE + SKINCOLOR_CREAMSICLE,8, // 55 // SKINCOLOR_PERIWINKLE + SKINCOLOR_ORANGE,8, // 56 // SKINCOLOR_BLUE SKINCOLOR_PUMPKIN,8, // 57 // SKINCOLOR_BLUEBERRY SKINCOLOR_DAWN,6, // 58 // SKINCOLOR_DUSK SKINCOLOR_EMERALD,8, // 59 // SKINCOLOR_PURPLE @@ -191,9 +191,9 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 120, 121, 121, 122, 122, 123, 124, 125, 126, 128, 129, 131, 133, 135}, // SKINCOLOR_SALMON {120, 121, 121, 122, 144, 145, 146, 147, 148, 149, 150, 151, 134, 136, 138, 140}, // SKINCOLOR_PINK {144, 145, 146, 147, 148, 149, 150, 151, 134, 135, 136, 137, 138, 139, 140, 141}, // SKINCOLOR_ROSE + {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY {120, 121, 122, 123, 124, 125, 126, 127, 128, 130, 131, 133, 134, 136, 137, 139}, // SKINCOLOR_RASPBERRY {125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137, 138, 139, 140}, // SKINCOLOR_RED - {121, 122, 145, 146, 147, 149, 131, 132, 133, 134, 135, 197, 197, 198, 199, 255}, // SKINCOLOR_RUBY {130, 131, 132, 133, 134, 136, 137, 138, 139, 139, 140, 140, 141, 141, 142, 143}, // SKINCOLOR_CRIMSON {104, 113, 113, 85, 86, 88, 128, 129, 131, 133, 134, 136, 138, 139, 141, 143}, // SKINCOLOR_KETCHUP {120, 121, 122, 123, 124, 147, 147, 148, 90, 91, 92, 93, 94, 95, 152, 154}, // SKINCOLOR_DAWN @@ -213,7 +213,6 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {121, 144, 145, 72, 73, 84, 114, 115, 107, 108, 109, 183, 223, 207, 30, 246}, // SKINCOLOR_VOMIT { 98, 99, 112, 101, 113, 114, 106, 179, 180, 180, 181, 182, 183, 173, 174, 175}, // SKINCOLOR_GARDEN { 96, 97, 99, 100, 102, 104, 160, 162, 164, 166, 168, 171, 223, 223, 207, 31}, // SKINCOLOR_LIME - {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM {120, 120, 176, 176, 176, 177, 177, 178, 178, 179, 179, 180, 180, 181, 182, 183}, // SKINCOLOR_TEA {120, 120, 176, 176, 177, 177, 178, 179, 165, 166, 167, 168, 169, 170, 171, 172}, // SKINCOLOR_PISTACHIO {176, 176, 177, 178, 165, 166, 167, 167, 168, 169, 182, 182, 182, 183, 183, 183}, // SKINCOLOR_ROBOHOOD @@ -223,6 +222,7 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {160, 161, 162, 164, 165, 167, 169, 170, 171, 171, 172, 173, 174, 175, 30, 31}, // SKINCOLOR_PINETREE {160, 184, 184, 185, 185, 186, 186, 187, 187, 188, 188, 189, 189, 190, 191, 175}, // SKINCOLOR_EMERALD {186, 187, 188, 188, 188, 189, 189, 190, 190, 191, 175, 175, 30, 30, 31, 31}, // SKINCOLOR_SWAMP + {120, 120, 80, 80, 81, 177, 162, 164, 228, 228, 204, 204, 205, 205, 206, 207}, // SKINCOLOR_DREAM {120, 208, 208, 210, 212, 214, 220, 220, 220, 221, 221, 222, 222, 223, 223, 191}, // SKINCOLOR_AQUA {210, 213, 220, 220, 220, 216, 216, 221, 221, 221, 222, 222, 223, 223, 191, 31}, // SKINCOLOR_TEAL {120, 120, 208, 208, 209, 210, 211, 212, 213, 215, 216, 217, 218, 219, 222, 223}, // SKINCOLOR_CYAN @@ -232,9 +232,9 @@ UINT8 colortranslations[MAXSKINCOLORS][16] = { {120, 120, 200, 200, 200, 201, 201, 201, 202, 202, 202, 203, 204, 205, 206, 207}, // SKINCOLOR_SLATE {120, 200, 200, 201, 201, 202, 202, 203, 203, 204, 204, 205, 205, 206, 207, 31}, // SKINCOLOR_STEEL {225, 226, 227, 228, 229, 205, 205, 206, 207, 207, 28, 28, 29, 29, 30, 31}, // SKINCOLOR_JET + {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE {120, 224, 225, 226, 226, 227, 228, 228, 229, 230, 231, 234, 235, 237, 239, 241}, // SKINCOLOR_PERIWINKLE {224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239}, // SKINCOLOR_BLUE - {208, 209, 211, 213, 215, 217, 229, 230, 232, 234, 236, 238, 240, 242, 244, 246}, // SKINCOLOR_SAPPHIRE {228, 229, 230, 231, 232, 233, 234, 235, 237, 238, 239, 240, 242, 243, 244, 245}, // SKINCOLOR_BLUEBERRY {192, 192, 248, 249, 250, 251, 204, 204, 205, 205, 206, 206, 207, 29, 30, 31}, // SKINCOLOR_DUSK {192, 192, 192, 193, 193, 194, 194, 195, 195, 196, 196, 197, 197, 198, 198, 199}, // SKINCOLOR_PURPLE From d1dc8a24f35af768b4b16d5ad3fae4a0a13dc44a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 14:28:38 -0400 Subject: [PATCH 32/44] Dream is green, Olive is yellow --- src/hu_stuff.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index ab427b486..133db0c84 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -741,11 +741,11 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x8f"; // V_PEACHMAP else if (color <= SKINCOLOR_BRONZE) cstart = "\x8A"; // V_GOLDMAP - else if (color <= SKINCOLOR_MUSTARD) + else if (color <= SKINCOLOR_OLIVE) cstart = "\x82"; // V_YELLOWMAP else if (color <= SKINCOLOR_PISTACHIO) cstart = "\x8b"; // V_TEAMAP - else if (color <= SKINCOLOR_SWAMP || color == SKINCOLOR_LIME) + else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME) cstart = "\x83"; // V_GREENMAP else if (color <= SKINCOLOR_TEAL) cstart = "\x8e"; // V_TEALMAP From 0a693789d63532a689dbdd6a3156add6a88151ed Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 14:30:54 -0400 Subject: [PATCH 33/44] Edit the text remaps Lighter sky, lighter pink, steel is now called steel-blue --- src/console.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/console.c b/src/console.c index ab8635b66..adc94d8a2 100644 --- a/src/console.c +++ b/src/console.c @@ -154,7 +154,7 @@ static CV_PossibleValue_t menuhighlight_cons_t[] = {V_GOLDMAP, "Always gold"}, {V_LAVENDERMAP, "Always lavender"}, {V_TEAMAP, "Always tea-green"}, - {V_STEELMAP, "Always steel"}, + {V_STEELMAP, "Always steel-blue"}, {V_PINKMAP, "Always pink"}, {V_TEALMAP, "Always teal"}, {V_PEACHMAP, "Always peach"}, @@ -330,12 +330,12 @@ static void CON_SetupColormaps(void) redmap[120] = (UINT8)126; // battle graymap[120] = (UINT8)10; orangemap[120] = (UINT8)85; // record attack - skymap[120] = (UINT8)214; // race + skymap[120] = (UINT8)212; // race lavendermap[120] = (UINT8)248; goldmap[120] = (UINT8)114; teamap[120] = (UINT8)177; steelmap[120] = (UINT8)201; - pinkmap[120] = (UINT8)124; + pinkmap[120] = (UINT8)144; tealmap[120] = (UINT8)220; peachmap[120] = (UINT8)69; // nice From eeb60035951b743e5233d09c44b687adc1b26272 Mon Sep 17 00:00:00 2001 From: Sryder Date: Thu, 4 Oct 2018 21:08:47 +0100 Subject: [PATCH 34/44] Disable VSync by default. I wouldn't be surprised if there are issues that arise from it, and I'm fairly sure its always been slightly spotty. --- src/android/i_video.c | 2 +- src/djgppdos/vid_vesa.c | 6 +++--- src/dummy/i_video.c | 2 +- src/nds/i_video.c | 2 +- src/sdl/i_video.c | 2 +- src/sdl12/i_video.c | 2 +- src/win32/win_vid.c | 2 +- src/win32ce/win_vid.c | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/android/i_video.c b/src/android/i_video.c index 2d0151f5e..8b4bee314 100644 --- a/src/android/i_video.c +++ b/src/android/i_video.c @@ -16,7 +16,7 @@ boolean allow_fullscreen = false; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void I_StartupGraphics(void){} diff --git a/src/djgppdos/vid_vesa.c b/src/djgppdos/vid_vesa.c index ec7b8b886..01a27dcea 100644 --- a/src/djgppdos/vid_vesa.c +++ b/src/djgppdos/vid_vesa.c @@ -46,7 +46,7 @@ static void VID_Command_ModeInfo_f (void); static void VID_Command_ModeList_f (void); static void VID_Command_Mode_f (void); -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #define VBEVERSION 2 // we need vesa2 or higher @@ -92,8 +92,8 @@ static vmode_t *pcurrentmode; // the current active videomode. // table des modes videos. -// seul le mode 320x200x256c standard VGA est support‚ sans le VESA. -// ce mode est le mode num‚ro 0 dans la liste. +// seul le mode 320x200x256c standard VGA est support� sans le VESA. +// ce mode est le mode num�ro 0 dans la liste. typedef struct { int modenum; // vesa vbe2.0 modenum diff --git a/src/dummy/i_video.c b/src/dummy/i_video.c index e167e833f..93ba6b751 100644 --- a/src/dummy/i_video.c +++ b/src/dummy/i_video.c @@ -8,7 +8,7 @@ boolean highcolor = false; boolean allow_fullscreen = false; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void I_StartupGraphics(void){} diff --git a/src/nds/i_video.c b/src/nds/i_video.c index 3dfb99557..06969dfd5 100644 --- a/src/nds/i_video.c +++ b/src/nds/i_video.c @@ -32,7 +32,7 @@ boolean highcolor = false; boolean allow_fullscreen = false; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; void I_StartupGraphics(void) { diff --git a/src/sdl/i_video.c b/src/sdl/i_video.c index 5cb319f6b..590158c8a 100644 --- a/src/sdl/i_video.c +++ b/src/sdl/i_video.c @@ -94,7 +94,7 @@ rendermode_t rendermode=render_soft; boolean highcolor = false; // synchronize page flipping with screen refresh -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; UINT8 graphics_started = 0; // Is used in console.c and screen.c diff --git a/src/sdl12/i_video.c b/src/sdl12/i_video.c index ac9d4ffce..69cf5ca9c 100644 --- a/src/sdl12/i_video.c +++ b/src/sdl12/i_video.c @@ -150,7 +150,7 @@ boolean highcolor = false; #if defined(DC) || (defined(GP2X) && !defined(HAVE_GP2XSDL)) consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #else -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; #endif static consvar_t cv_stretch = {"stretch", "Off", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/win32/win_vid.c b/src/win32/win_vid.c index 30fada8e9..f355eaea2 100644 --- a/src/win32/win_vid.c +++ b/src/win32/win_vid.c @@ -51,7 +51,7 @@ rendermode_t rendermode = render_soft; static void OnTop_OnChange(void); // synchronize page flipping with screen refresh static CV_PossibleValue_t CV_NeverOnOff[] = {{-1, "Never"}, {0, "Off"}, {1, "On"}, {0, NULL}}; -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, OnTop_OnChange, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_ontop = {"ontop", "Never", 0, CV_NeverOnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; diff --git a/src/win32ce/win_vid.c b/src/win32ce/win_vid.c index b9c2e131f..5e8e7e1fb 100644 --- a/src/win32ce/win_vid.c +++ b/src/win32ce/win_vid.c @@ -48,7 +48,7 @@ rendermode_t rendermode = render_soft; // synchronize page flipping with screen refresh -consvar_t cv_vidwait = {"vid_wait", "On", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; +consvar_t cv_vidwait = {"vid_wait", "Off", CV_SAVE, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; static consvar_t cv_stretch = {"stretch", "On", CV_SAVE|CV_NOSHOWHELP, CV_OnOff, NULL, 0, NULL, NULL, 0, 0, NULL}; boolean highcolor; From 3b2728054d2fc9d881c14bfa7654c9d48f562ab7 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 17:50:50 -0400 Subject: [PATCH 35/44] Always move the camera According to wolfs, this improves fps. Let's confirm, shall we? --- src/d_main.c | 14 -------------- src/p_tick.c | 10 ++++++++++ src/p_user.c | 8 -------- 3 files changed, 10 insertions(+), 22 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index e56a631a2..6e3d4d735 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -723,20 +723,6 @@ void D_SRB2Loop(void) } else if (rendertimeout < entertic) // in case the server hang or netsplit { - // Lagless camera! Yay! - /* Not yay, it ruins Kart's drift :y - if (gamestate == GS_LEVEL && netgame) - { - if (camera.chase) - P_MoveChaseCamera(&players[displayplayer], &camera, false); - if (splitscreen && camera2.chase) - P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false); - if (splitscreen > 1 && camera3.chase) - P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false); - if (splitscreen > 2 && camera4.chase) - P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false); - } - */ D_Display(); if (moviemode) diff --git a/src/p_tick.c b/src/p_tick.c index 3c5ed0b9e..c9c324337 100644 --- a/src/p_tick.c +++ b/src/p_tick.c @@ -748,6 +748,16 @@ void P_Ticker(boolean run) D_MapChange(gamemap, gametype, encoremode, true, 0, false, false); } + // Always move the camera. + if (camera.chase) + P_MoveChaseCamera(&players[displayplayer], &camera, false); + if (splitscreen && camera2.chase) + P_MoveChaseCamera(&players[secondarydisplayplayer], &camera2, false); + if (splitscreen > 1 && camera3.chase) + P_MoveChaseCamera(&players[thirddisplayplayer], &camera3, false); + if (splitscreen > 2 && camera4.chase) + P_MoveChaseCamera(&players[fourthdisplayplayer], &camera4, false); + P_MapEnd(); // Z_CheckMemCleanup(); diff --git a/src/p_user.c b/src/p_user.c index d3407bd65..f33b46d24 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -9546,12 +9546,6 @@ void P_PlayerAfterThink(player_t *player) if (player->playerstate == PST_DEAD) { - // camera may still move when guy is dead - //if (!netgame) - { - if (thiscam && thiscam->chase) - P_MoveChaseCamera(player, thiscam, false); - } return; } @@ -9833,8 +9827,6 @@ void P_PlayerAfterThink(player_t *player) player->viewz = player->mo->z + player->mo->height - player->viewheight; else player->viewz = player->mo->z + player->viewheight; - if (server || addedtogame) - P_MoveChaseCamera(player, thiscam, false); // calculate the camera movement } } From a67e375fe9fdfc97baf40aab41bc1a6ffacdfe2f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 18:07:56 -0400 Subject: [PATCH 36/44] Brown text colormap instead of teal, revert sky-blue --- src/console.c | 14 +++++++------- src/console.h | 2 +- src/dehacked.c | 2 +- src/hu_stuff.c | 6 ++---- src/v_video.c | 4 ++-- src/v_video.h | 2 +- 6 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/console.c b/src/console.c index adc94d8a2..f79a6faf5 100644 --- a/src/console.c +++ b/src/console.c @@ -156,7 +156,7 @@ static CV_PossibleValue_t menuhighlight_cons_t[] = {V_TEAMAP, "Always tea-green"}, {V_STEELMAP, "Always steel-blue"}, {V_PINKMAP, "Always pink"}, - {V_TEALMAP, "Always teal"}, + {V_BROWNMAP, "Always brown"}, {V_PEACHMAP, "Always peach"}, {0, NULL} }; @@ -291,7 +291,7 @@ static void CONS_backcolor_Change(void) // TODO: This could probably be improved somehow... // These colormaps are 99% identical, with just a few changed bytes UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ - *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; + *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap; static void CON_SetupColormaps(void) { @@ -311,8 +311,8 @@ static void CON_SetupColormaps(void) teamap = (goldmap+256); steelmap = (teamap+256); pinkmap = (steelmap+256); - tealmap = (pinkmap+256); - peachmap = (tealmap+256); + brownmap = (pinkmap+256); + peachmap = (brownmap+256); // setup the other colormaps, for console text @@ -330,13 +330,13 @@ static void CON_SetupColormaps(void) redmap[120] = (UINT8)126; // battle graymap[120] = (UINT8)10; orangemap[120] = (UINT8)85; // record attack - skymap[120] = (UINT8)212; // race + skymap[120] = (UINT8)214; // race lavendermap[120] = (UINT8)248; goldmap[120] = (UINT8)114; teamap[120] = (UINT8)177; steelmap[120] = (UINT8)201; - pinkmap[120] = (UINT8)144; - tealmap[120] = (UINT8)220; + pinkmap[120] = (UINT8)145; + brownmap[120] = (UINT8)48; peachmap[120] = (UINT8)69; // nice // Init back colormap diff --git a/src/console.h b/src/console.h index b15ccb6f1..e4f01c8eb 100644 --- a/src/console.h +++ b/src/console.h @@ -39,7 +39,7 @@ extern UINT32 con_scalefactor; // console text scale factor extern consvar_t cons_backcolor, cons_menuhighlight; extern UINT8 *yellowmap, *purplemap, *greenmap, *bluemap, *graymap, *redmap, *orangemap,\ - *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *tealmap, *peachmap; + *skymap, *goldmap, *lavendermap, *teamap, *steelmap, *pinkmap, *brownmap, *peachmap; // Console bg color (auto updated to match) extern UINT8 *consolebgmap; diff --git a/src/dehacked.c b/src/dehacked.c index baa35b748..04301ef2c 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8264,7 +8264,7 @@ struct { {"V_TEAMAP",V_TEAMAP}, {"V_STEELMAP",V_STEELMAP}, {"V_PINKMAP",V_PINKMAP}, - {"V_TEALMAP",V_TEALMAP}, + {"V_BROWNMAP",V_BROWNMAP}, {"V_PEACHMAP",V_PEACHMAP}, {"V_TRANSLUCENT",V_TRANSLUCENT}, {"V_10TRANS",V_10TRANS}, diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 133db0c84..838e8129c 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -727,10 +727,10 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) const UINT8 color = players[playernum].skincolor; if (color <= SKINCOLOR_SILVER || color == SKINCOLOR_SLATE) cstart = "\x80"; // white - else if (color <= SKINCOLOR_BEIGE || color == SKINCOLOR_JET) + else if (color <= SKINCOLOR_BLACK || color == SKINCOLOR_JET) cstart = "\x86"; // V_GRAYMAP else if (color <= SKINCOLOR_LEATHER) - cstart = "\x8A"; // V_GOLDMAP + cstart = "\x8e"; // V_BROWNMAP else if (color <= SKINCOLOR_ROSE || color == SKINCOLOR_LILAC) cstart = "\x8d"; // V_PINKMAP else if (color <= SKINCOLOR_KETCHUP) @@ -747,8 +747,6 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) cstart = "\x8b"; // V_TEAMAP else if (color <= SKINCOLOR_DREAM || color == SKINCOLOR_LIME) cstart = "\x83"; // V_GREENMAP - else if (color <= SKINCOLOR_TEAL) - cstart = "\x8e"; // V_TEALMAP else if (color <= SKINCOLOR_NAVY || color == SKINCOLOR_SAPPHIRE) cstart = "\x88"; // V_SKYMAP else if (color <= SKINCOLOR_STEEL) diff --git a/src/v_video.c b/src/v_video.c index 46d34acce..8a1a37370 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1282,8 +1282,8 @@ UINT8 *V_GetStringColormap(INT32 colorflags) return steelmap; case 13: // 0x8D, pink return pinkmap; - case 14: // 0x8E, teal - return tealmap; + case 14: // 0x8E, brown + return brownmap; case 15: // 0x8F, peach return peachmap; default: // reset diff --git a/src/v_video.h b/src/v_video.h index f6826cf7b..734b80374 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -82,7 +82,7 @@ extern UINT8 hudtrans; #define V_TEAMAP 0x0000B000 #define V_STEELMAP 0x0000C000 #define V_PINKMAP 0x0000D000 -#define V_TEALMAP 0x0000E000 +#define V_BROWNMAP 0x0000E000 #define V_PEACHMAP 0x0000F000 // use bits 17-20 for alpha transparency From 99ce5f5700c35adadb7aa28de3f5981ab53d417f Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 20:08:29 -0400 Subject: [PATCH 37/44] Revert "Attempt to not let the camera into thok barriers" This reverts commit 6f10f15627a1a82a63028255db8466865d9c8e68. --- src/p_map.c | 19 +++++-------------- src/p_mobj.c | 2 -- 2 files changed, 5 insertions(+), 16 deletions(-) diff --git a/src/p_map.c b/src/p_map.c index 11dda089e..b249f3628 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2181,12 +2181,6 @@ boolean P_CheckCameraPosition(fixed_t x, fixed_t y, camera_t *thiscam) mapcampointer = thiscam; -#ifdef NOCLIPCAM - if (newsubsec->sector->floorheight >= newsubsec->sector->ceilingheight - || newsubsec->sector->ceilingheight <= newsubsec->sector->floorheight) - return false; -#endif - if (GETSECSPECIAL(newsubsec->sector->special, 4) == 12) { // Camera noclip on entire sector. tmfloorz = tmdropoffz = thiscam->z; @@ -2384,15 +2378,12 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) fixed_t tryx = thiscam->x; fixed_t tryy = thiscam->y; -#ifdef NOCLIPCAM - if (!(s->sector->floorheight >= s->sector->ceilingheight - || s->sector->ceilingheight <= s->sector->floorheight)) -#else +#ifndef NOCLIPCAM if ((thiscam == &camera && (players[displayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) - || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) - || (leveltime < introtime)) + || (thiscam == &camera2 && (players[secondarydisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera3 && (players[thirddisplayplayer].pflags & PF_NOCLIP)) + || (thiscam == &camera4 && (players[fourthdisplayplayer].pflags & PF_NOCLIP)) + || (leveltime < introtime)) #endif { // Noclipping player camera noclips too!! floatok = true; diff --git a/src/p_mobj.c b/src/p_mobj.c index 456c0acfa..d22d5cb61 100644 --- a/src/p_mobj.c +++ b/src/p_mobj.c @@ -3702,7 +3702,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled { if (!P_TryCameraMove(thiscam->x + thiscam->momx, thiscam->y + thiscam->momy, thiscam)) { // Never fails for 2D mode. -#ifndef NOCLIPCAM mobj_t dummy; dummy.thinker.function.acp1 = (actionf_p1)P_MobjThinker; dummy.subsector = thiscam->subsector; @@ -3713,7 +3712,6 @@ boolean P_CameraThinker(player_t *player, camera_t *thiscam, boolean resetcalled if (!resetcalled && !(player->pflags & PF_NOCLIP || leveltime < introtime) && !P_CheckSight(&dummy, player->mo)) // TODO: "P_CheckCameraSight" instead. P_ResetCamera(player, thiscam); else -#endif P_SlideCameraMove(thiscam); if (resetcalled) // Okay this means the camera is fully reset. return true; From bd812b6ece0ee608bcc35468946ebe906ed5dc40 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Thu, 4 Oct 2018 23:58:44 -0400 Subject: [PATCH 38/44] -skill launcher option Requested by Sev(?), for map editing; sets kartspeed using the same name as Doom's difficulty launcher option --- src/d_main.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/d_main.c b/src/d_main.c index e56a631a2..214bfac67 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -1484,6 +1484,29 @@ void D_SRB2Main(void) } } + if (M_CheckParm("-skill") && M_IsNextParm()) + { + INT32 j; + INT16 newskill = -1; + const char *sskill = M_GetNextParm(); + + for (j = 0; kartspeed_cons_t[j].strvalue; j++) + if (!strcasecmp(kartspeed_cons_t[j].strvalue, sskill)) + { + newskill = (INT16)kartspeed_cons_t[j].value; + break; + } + if (!kartspeed_cons_t[j].strvalue) // reached end of the list with no match + { + j = atoi(sskill); // assume they gave us a skill number, which is okay too + if (j >= 0 && j <= 2) + newskill = (INT16)j; + } + + if (newskill != -1) + CV_SetValue(&cv_kartspeed, newskill); + } + if (server && !M_CheckParm("+map")) { // Prevent warping to nonexistent levels From d4bc7d14ba37662be20ac842eb5d110ba1f7f1fe Mon Sep 17 00:00:00 2001 From: Latapostrophe Date: Fri, 5 Oct 2018 12:13:11 +0200 Subject: [PATCH 39/44] Say-team (key and command) now depend of G_GametypeHasTeams(), so you'll only have to modify this function to have say-team work in the gametypes of your choice. --- src/hu_stuff.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 255d8512b..adecc8cb8 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -567,8 +567,11 @@ static void Command_Sayteam_f(void) CONS_Alert(CONS_NOTICE, M_GetText("Dedicated servers can't send team messages. Use \"say\".\n")); return; } - - DoSayCommand(-1, 1, 0); + + if (G_GametypeHasTeams()) // revert to normal say if we don't have teams in this gametype. + DoSayCommand(-1, 1, 0); + else + DoSayCommand(0, 1, 0); } /** Send a message to everyone, to be displayed by CECHO. Only @@ -1067,8 +1070,6 @@ boolean HU_Responder(event_t *ev) if ((ev->data1 == gamecontrol[gc_talkkey][0] || ev->data1 == gamecontrol[gc_talkkey][1]) && netgame && !OLD_MUTE) // check for old chat mute, still let the players open the chat incase they want to scroll otherwise. { - //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - // return false; chat_on = true; w_chat[0] = 0; teamtalk = false; @@ -1078,12 +1079,9 @@ boolean HU_Responder(event_t *ev) if ((ev->data1 == gamecontrol[gc_teamkey][0] || ev->data1 == gamecontrol[gc_teamkey][1]) && netgame && !OLD_MUTE) { - //if (cv_mute.value && !(server || IsPlayerAdmin(consoleplayer))) - // return false; chat_on = true; w_chat[0] = 0; - teamtalk = false; // CHANGE THIS TO TRUE TO MAKE SAYTEAM WORK AGAIN - //teamtalk = true; + teamtalk = G_GametypeHasTeams(); // Don't teamtalk if we don't have teams. chat_scrollmedown = true; return true; } From 977130dbf6765437fabe24a899ca4cec3328e12c Mon Sep 17 00:00:00 2001 From: toaster Date: Fri, 5 Oct 2018 23:24:26 +0100 Subject: [PATCH 40/44] Halt frame-perfect egg crash. (The code is slightly modified from what I put in bug-reports as a potential fix, but I'm glad I was on the right track.) --- src/p_inter.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/p_inter.c b/src/p_inter.c index bd02da429..5ca9a1041 100644 --- a/src/p_inter.c +++ b/src/p_inter.c @@ -494,11 +494,19 @@ void P_TouchSpecialThing(mobj_t *special, mobj_t *toucher, boolean heightcheck) K_StripOther(player); player->kartstuff[k_itemroulette] = 1; player->kartstuff[k_roulettetype] = 2; - if (special->target && special->target->player - && (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0)) - player->kartstuff[k_eggmanblame] = special->target->player-players; - else - player->kartstuff[k_eggmanblame] = player-players; + if (special->target && special->target->player) + { + if (G_RaceGametype() || special->target->player->kartstuff[k_bumper] > 0) + player->kartstuff[k_eggmanblame] = special->target->player-players; + else + player->kartstuff[k_eggmanblame] = player-players; + + if (special->target->hnext == special) + { + P_SetTarget(&special->target->hnext, NULL); + special->target->player->kartstuff[k_eggmanheld] = 0; + } + } P_RemoveMobj(special); return; From 3ed027a4f75c5d41bfd8738ba26a6987307b3603 Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 15:13:57 -0400 Subject: [PATCH 41/44] Remove R_DoorClosed This function has caused me, so much unexpected pain because of just how out of the way it is, and NOTHING else uses it --- src/r_bsp.c | 30 +++++------------------------- 1 file changed, 5 insertions(+), 25 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index 34b082caf..d47c1140c 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -222,30 +222,6 @@ void R_PortalClearClipSegs(INT32 start, INT32 end) newend = solidsegs + 2; } - -// R_DoorClosed -// -// This function is used to fix the automap bug which -// showed lines behind closed doors simply because the door had a dropoff. -// -// It assumes that Doom has already ruled out a door being closed because -// of front-back closure (e.g. front floor is taller than back ceiling). -static INT32 R_DoorClosed(void) -{ - return - - // if door is closed because back is shut: - backsector->ceilingheight <= backsector->floorheight - - // preserve a kind of transparent door/lift special effect: - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) - - // properly render skies (consider door "open" if both ceilings are sky): - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum); -} - // // If player's view height is underneath fake floor, lower the // drawn ceiling to be just under the floor height, and replace @@ -534,7 +510,11 @@ static void R_AddLine(seg_t *line) } // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = R_DoorClosed(); + doorclosed = (backsector->ceilingheight <= backsector->floorheight + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + if (doorclosed) goto clipsolid; From 8d39d4be31c69dfade58f51c24d64f2e58f8a9aa Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 16:22:36 -0400 Subject: [PATCH 42/44] Do clipsolid for doorclosed only while your camera is outside of the sector --- src/r_bsp.c | 55 +++++++++++++++++++++++++------------------- src/r_segs.c | 65 ++++++++++++++++++++++++++++------------------------ 2 files changed, 66 insertions(+), 54 deletions(-) diff --git a/src/r_bsp.c b/src/r_bsp.c index d47c1140c..da9ad6656 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -374,6 +374,7 @@ static void R_AddLine(seg_t *line) INT32 x1, x2; angle_t angle1, angle2, span, tspan; static sector_t tempsec; // ceiling/water hack + sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -478,21 +479,24 @@ static void R_AddLine(seg_t *line) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) #undef SLOPEPARAMS - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + if (thissec != backsector && thissec != frontsector) { - goto clipsolid; + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } + + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backc1 <= backf1 && backc2 <= backf2 + && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) + && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; } - // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backc1 <= backf1 && backc2 <= backf2 - && ((backc1 >= frontc1 && backc2 >= frontc2) || curline->sidedef->toptexture) - && ((backf1 <= frontf1 && backf2 >= frontf2) || curline->sidedef->bottomtexture) - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); - - if (doorclosed) - goto clipsolid; - // Window. if (backc1 != frontc1 || backc2 != frontc2 || backf1 != frontf1 || backf2 != frontf2) @@ -503,21 +507,24 @@ static void R_AddLine(seg_t *line) else #endif { - if (backsector->ceilingheight <= frontsector->floorheight - || backsector->floorheight >= frontsector->ceilingheight) + if (thissec != backsector && thissec != frontsector) { - goto clipsolid; + if (backsector->ceilingheight <= frontsector->floorheight + || backsector->floorheight >= frontsector->ceilingheight) + { + goto clipsolid; + } + + // Check for automap fix. Store in doorclosed for r_segs.c + doorclosed = (backsector->ceilingheight <= backsector->floorheight + && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) + && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) + && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); + + if (doorclosed) + goto clipsolid; } - // Check for automap fix. Store in doorclosed for r_segs.c - doorclosed = (backsector->ceilingheight <= backsector->floorheight - && (backsector->ceilingheight >= frontsector->ceilingheight || curline->sidedef->toptexture) - && (backsector->floorheight <= frontsector->floorheight || curline->sidedef->bottomtexture) - && (backsector->ceilingpic != skyflatnum || frontsector->ceilingpic != skyflatnum)); - - if (doorclosed) - goto clipsolid; - // Window. if (backsector->ceilingheight != frontsector->ceilingheight || backsector->floorheight != frontsector->floorheight) diff --git a/src/r_segs.c b/src/r_segs.c index 11287f16d..84bb119fd 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -2020,6 +2020,8 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // two sided line + sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; + #ifdef ESLOPE if (backsector->c_slope) { worldhigh = P_GetZAt(backsector->c_slope, segleft.x, segleft.y) - viewz; @@ -2113,52 +2115,55 @@ void R_StoreWallRange(INT32 start, INT32 stop) // ds_p->sprtopclip = screenheightarray; } -#ifdef ESLOPE - if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) -#else - if (worldhigh <= worldbottom) -#endif - { - ds_p->sprbottomclip = negonearray; - ds_p->bsilheight = INT32_MAX; - ds_p->silhouette |= SIL_BOTTOM; - } - -#ifdef ESLOPE - if (worldlow >= worldtop && worldlowslope >= worldtopslope) -#else - if (worldlow >= worldtop) -#endif - { - ds_p->sprtopclip = screenheightarray; - ds_p->tsilheight = INT32_MIN; - ds_p->silhouette |= SIL_TOP; - } - - //SoM: 3/25/2000: This code fixes an automap bug that didn't check - // frontsector->ceiling and backsector->floor to see if a door was closed. - // Without the following code, sprites get displayed behind closed doors. + if (thissec != frontsector && thissec != backsector) { #ifdef ESLOPE - if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) + if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope) #else - if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) + if (worldhigh <= worldbottom) #endif { ds_p->sprbottomclip = negonearray; ds_p->bsilheight = INT32_MAX; ds_p->silhouette |= SIL_BOTTOM; } + #ifdef ESLOPE - if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) + if (worldlow >= worldtop && worldlowslope >= worldtopslope) #else - if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) + if (worldlow >= worldtop) #endif - { // killough 1/17/98, 2/8/98 + { ds_p->sprtopclip = screenheightarray; ds_p->tsilheight = INT32_MIN; ds_p->silhouette |= SIL_TOP; } + + //SoM: 3/25/2000: This code fixes an automap bug that didn't check + // frontsector->ceiling and backsector->floor to see if a door was closed. + // Without the following code, sprites get displayed behind closed doors. + { +#ifdef ESLOPE + if (doorclosed || (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)) +#else + if (doorclosed || backsector->ceilingheight <= frontsector->floorheight) +#endif + { + ds_p->sprbottomclip = negonearray; + ds_p->bsilheight = INT32_MAX; + ds_p->silhouette |= SIL_BOTTOM; + } +#ifdef ESLOPE + if (doorclosed || (worldlow >= worldtop && worldlowslope >= worldtopslope)) +#else + if (doorclosed || backsector->floorheight >= frontsector->ceilingheight) +#endif + { // killough 1/17/98, 2/8/98 + ds_p->sprtopclip = screenheightarray; + ds_p->tsilheight = INT32_MIN; + ds_p->silhouette |= SIL_TOP; + } + } } if (worldlow != worldbottom From d8cf9327a6f13c12032a8b17d4b0465de6e32e5a Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 19:25:59 -0400 Subject: [PATCH 43/44] OGL support --- src/hardware/hw_main.c | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 6a664d39b..774ff8c1c 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2690,6 +2690,8 @@ static void HWR_AddLine(seg_t * line) // SoM: Backsector needs to be run through R_FakeFlat static sector_t tempsec; + sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; + if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -2811,11 +2813,14 @@ static void HWR_AddLine(seg_t * line) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) #undef SLOPEPARAMS - // Closed door. - if ((backc1 <= frontf1 && backc2 <= frontf2) - || (backf1 >= frontc1 && backf2 >= frontc2)) + if (thissec != gr_backsector && thissec != gr_frontsector) { - goto clipsolid; + // Closed door. + if ((backc1 <= frontf1 && backc2 <= frontf2) + || (backf1 >= frontc1 && backf2 >= frontc2)) + { + goto clipsolid; + } } // Window. @@ -2828,10 +2833,13 @@ static void HWR_AddLine(seg_t * line) else #endif { - // Closed door. - if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || - gr_backsector->floorheight >= gr_frontsector->ceilingheight) - goto clipsolid; + if (thissec != gr_backsector && thissec != gr_frontsector) + { + // Closed door. + if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || + gr_backsector->floorheight >= gr_frontsector->ceilingheight) + goto clipsolid; + } // Window. if (gr_backsector->ceilingheight != gr_frontsector->ceilingheight || From f026615dfe941bffc2715eda714a58c37d0dc9bf Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Sat, 6 Oct 2018 23:37:27 -0400 Subject: [PATCH 44/44] Don't need thissec --- src/hardware/hw_main.c | 6 ++---- src/r_bsp.c | 5 ++--- src/r_segs.c | 6 ++---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/src/hardware/hw_main.c b/src/hardware/hw_main.c index 774ff8c1c..2e4c733b0 100644 --- a/src/hardware/hw_main.c +++ b/src/hardware/hw_main.c @@ -2690,8 +2690,6 @@ static void HWR_AddLine(seg_t * line) // SoM: Backsector needs to be run through R_FakeFlat static sector_t tempsec; - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; - if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -2813,7 +2811,7 @@ static void HWR_AddLine(seg_t * line) SLOPEPARAMS( gr_backsector->c_slope, backc1, backc2, gr_backsector->ceilingheight) #undef SLOPEPARAMS - if (thissec != gr_backsector && thissec != gr_frontsector) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { // Closed door. if ((backc1 <= frontf1 && backc2 <= frontf2) @@ -2833,7 +2831,7 @@ static void HWR_AddLine(seg_t * line) else #endif { - if (thissec != gr_backsector && thissec != gr_frontsector) + if (viewsector != gr_backsector && viewsector != gr_frontsector) { // Closed door. if (gr_backsector->ceilingheight <= gr_frontsector->floorheight || diff --git a/src/r_bsp.c b/src/r_bsp.c index da9ad6656..0c48ae8b4 100644 --- a/src/r_bsp.c +++ b/src/r_bsp.c @@ -374,7 +374,6 @@ static void R_AddLine(seg_t *line) INT32 x1, x2; angle_t angle1, angle2, span, tspan; static sector_t tempsec; // ceiling/water hack - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; if (line->polyseg && !(line->polyseg->flags & POF_RENDERSIDES)) return; @@ -479,7 +478,7 @@ static void R_AddLine(seg_t *line) SLOPEPARAMS( backsector->f_slope, backf1, backf2, backsector->floorheight) SLOPEPARAMS( backsector->c_slope, backc1, backc2, backsector->ceilingheight) #undef SLOPEPARAMS - if (thissec != backsector && thissec != frontsector) + if (viewsector != backsector && viewsector != frontsector) { if ((backc1 <= frontf1 && backc2 <= frontf2) || (backf1 >= frontc1 && backf2 >= frontc2)) @@ -507,7 +506,7 @@ static void R_AddLine(seg_t *line) else #endif { - if (thissec != backsector && thissec != frontsector) + if (viewsector != backsector && viewsector != frontsector) { if (backsector->ceilingheight <= frontsector->floorheight || backsector->floorheight >= frontsector->ceilingheight) diff --git a/src/r_segs.c b/src/r_segs.c index 84bb119fd..231a84f79 100644 --- a/src/r_segs.c +++ b/src/r_segs.c @@ -1365,7 +1365,7 @@ static void R_RenderSegLoop (void) if (bottom >= floorclip[rw_x]) bottom = floorclip[rw_x]-1; - if (top <= bottom) + if (top <= bottom && ceilingplane) { ceilingplane->top[rw_x] = (INT16)top; ceilingplane->bottom[rw_x] = (INT16)bottom; @@ -2020,8 +2020,6 @@ void R_StoreWallRange(INT32 start, INT32 stop) { // two sided line - sector_t *thissec = R_PointInSubsector(viewx, viewy)->sector; - #ifdef ESLOPE if (backsector->c_slope) { worldhigh = P_GetZAt(backsector->c_slope, segleft.x, segleft.y) - viewz; @@ -2115,7 +2113,7 @@ void R_StoreWallRange(INT32 start, INT32 stop) // ds_p->sprtopclip = screenheightarray; } - if (thissec != frontsector && thissec != backsector) + if (viewsector != frontsector && viewsector != backsector) { #ifdef ESLOPE if (worldhigh <= worldbottom && worldhighslope <= worldbottomslope)