diff --git a/src/g_game.c b/src/g_game.c index 208674f2f..596c3f7d6 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1530,7 +1530,7 @@ boolean G_Responder(event_t *ev) if (gamestate == GS_LEVEL && ev->type == ev_keydown && (ev->data1 == KEY_F12 || ev->data1 == gamecontrol[0][gc_viewpoint][0] || ev->data1 == gamecontrol[0][gc_viewpoint][1])) { - if (!demo.playback && (r_splitscreen || !netgame)) + if (!demo.playback && (r_splitscreen)) g_localplayers[0] = consoleplayer; else { diff --git a/src/k_bot.c b/src/k_bot.c index 94a628d56..9c62b0ca2 100644 --- a/src/k_bot.c +++ b/src/k_bot.c @@ -13,6 +13,7 @@ #include "doomdef.h" #include "d_player.h" #include "g_game.h" +#include "p_mobj.h" #include "r_main.h" #include "p_local.h" #include "k_bot.h" @@ -167,9 +168,13 @@ void K_UpdateMatchRaceBots(void) } } - if (difficulty == 0 || !(gametyperules & GTR_BOTS) || bossinfo.boss == true) + if (difficulty == 0 || !(gametyperules & GTR_BOTS) || bossinfo.boss == true || numbosswaypoints > 0) { wantedbots = 0; + if (numbosswaypoints > 0) + { + CONS_Alert(CONS_ERROR, "Bots do not work on maps using the legacy checkpoint system.\nPlease consider using waypoints instead if bot support is desired!\n"); + } } else { @@ -278,7 +283,7 @@ boolean K_PlayerUsesBotMovement(player_t *player) boolean K_BotCanTakeCut(player_t *player) { if ( - (K_TripwirePassConditions(player) != TRIPWIRE_NONE || K_ApplyOffroad(player) == false) + ((K_TripwirePassConditions(player) != TRIPWIRE_NONE) || (K_ApplyOffroad(player) == false)) || player->itemtype == KITEM_SNEAKER || player->itemtype == KITEM_ROCKETSNEAKER || player->itemtype == KITEM_INVINCIBILITY diff --git a/src/k_grandprix.c b/src/k_grandprix.c index 077532fa3..f0349eb28 100644 --- a/src/k_grandprix.c +++ b/src/k_grandprix.c @@ -208,7 +208,16 @@ void K_InitGrandPrixBots(void) playercount += (numplayers-2) * 3; } - wantedbots = playercount - numplayers; + if (numbosswaypoints > 0) + { + CONS_Alert(CONS_ERROR, "Bots do not work on maps using the legacy checkpoint system.\nPlease consider using waypoints instead if bot support is desired!\n"); + wantedbots = 0; + } + else + { + + wantedbots = playercount - numplayers; + } // Create rival list if (numplayers > 0) diff --git a/src/k_hud.c b/src/k_hud.c index 2a010e944..d70992457 100644 --- a/src/k_hud.c +++ b/src/k_hud.c @@ -2493,7 +2493,8 @@ static void K_drawKartSpeedometer(void) { case 1: // Sonic Drift 2 style percentage default: - convSpeed = (stplyr->speed * 100) / K_GetKartSpeed(stplyr, false, true); // Based on top speed! + if (stplyr->mo) + convSpeed = (FixedDiv(stplyr->speed, FixedMul(K_GetKartSpeed(stplyr, false, false), ORIG_FRICTION))*100)>>FRACBITS; labeln = 0; break; case 2: // Kilometers diff --git a/src/p_map.c b/src/p_map.c index bea998ebd..834c1d321 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2722,24 +2722,32 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) { // Assign thing's standingslope if needed if (thing->z <= tmfloorz && !(thing->eflags & MFE_VERTICALFLIP)) { + + K_UpdateMobjTerrain(thing, tmfloorpic); + if (!startingonground && tmfloorslope) P_HandleSlopeLanding(thing, tmfloorslope); if (thing->momz <= 0) { thing->standingslope = tmfloorslope; + P_SetPitchRollFromSlope(thing, thing->standingslope); if (thing->momz == 0 && thing->player && !startingonground) P_PlayerHitFloor(thing->player, true); } } else if (thing->z+thing->height >= tmceilingz && (thing->eflags & MFE_VERTICALFLIP)) { + + K_UpdateMobjTerrain(thing, tmceilingpic); + if (!startingonground && tmceilingslope) P_HandleSlopeLanding(thing, tmceilingslope); if (thing->momz >= 0) { thing->standingslope = tmceilingslope; + P_SetPitchRollFromSlope(thing, thing->standingslope); if (thing->momz == 0 && thing->player && !startingonground) P_PlayerHitFloor(thing->player, true); @@ -2747,8 +2755,10 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) } } else // don't set standingslope if you're not going to clip against it + { thing->standingslope = NULL; - + thing->terrain = NULL; + } thing->x = x; thing->y = y; @@ -2774,10 +2784,7 @@ boolean P_TryMove(mobj_t *thing, fixed_t x, fixed_t y, boolean allowdropoff) oldside = P_PointOnLineSide(oldx, oldy, ld); if (side != oldside) { - if (ld->special) - { - P_CrossSpecialLine(ld, oldside, thing); - } + P_CrossSpecialLine(ld, oldside, thing); } } } diff --git a/src/p_maputl.c b/src/p_maputl.c index 96755c4fc..fe99e6f81 100644 --- a/src/p_maputl.c +++ b/src/p_maputl.c @@ -648,6 +648,7 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) fixed_t textop, texbottom, texheight; fixed_t texmid, delta1, delta2; INT32 texnum = R_GetTextureNum(side->midtexture); // make sure the texture is actually valid + vertex_t cross; if (texnum) { // Get the midtexture's height @@ -682,18 +683,22 @@ void P_LineOpening(line_t *linedef, mobj_t *mobj) texbottom = textop - texheight*(side->repeatcnt+1); } } + P_ClosestPointOnLine(tmx, tmy, linedef, &cross); + + if (P_GetMidtextureTopBottom(linedef, cross.x, cross.y, &textop, &texbottom)) + { + texmid = texbottom+(textop-texbottom)/2; - texmid = texbottom+(textop-texbottom)/2; + delta1 = abs(mobj->z - texmid); + delta2 = abs(thingtop - texmid); - delta1 = abs(mobj->z - texmid); - delta2 = abs(thingtop - texmid); - - if (delta1 > delta2) { // Below - if (opentop > texbottom) - opentop = texbottom; - } else { // Above - if (openbottom < textop) - openbottom = textop; + if (delta1 > delta2) { // Below + if (opentop > texbottom) + opentop = texbottom; + } else { // Above + if (openbottom < textop) + openbottom = textop; + } } } }