diff --git a/src/d_clisrv.c b/src/d_clisrv.c index 4253532b4..a7c6e0e9a 100644 --- a/src/d_clisrv.c +++ b/src/d_clisrv.c @@ -2773,8 +2773,8 @@ void CL_RemovePlayer(INT32 playernum, INT32 reason) RemoveAdminPlayer(playernum); // don't stay admin after you're gone } - if (playernum == g_localplayers[0] && !demo.playback) - g_localplayers[0] = consoleplayer; // don't look through someone's view who isn't there + if (playernum == displayplayers[0] && !demo.playback) + displayplayers[0] = consoleplayer; // don't look through someone's view who isn't there #ifdef HAVE_BLUA LUA_InvalidatePlayer(&players[playernum]); diff --git a/src/g_game.c b/src/g_game.c index 285a4c44f..7f6177eac 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -1770,14 +1770,6 @@ void G_DoLoadLevel(boolean resetplayer) if (!resetplayer) P_FindEmerald(); - g_localplayers[0] = consoleplayer; // view the guy you are playing - - for (i = 0; i < MAXSPLITSCREENPLAYERS; i++) - { - if (i > 0 && r_splitscreen < i) - g_localplayers[i] = consoleplayer; - } - gameaction = ga_nothing; #ifdef PARANOIA Z_CheckHeap(-2); diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 1044dee19..cf217ed1a 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -739,6 +739,7 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) { const char *prefix = "", *cstart = "", *cend = "", *adminchar = "\x82~\x83", *remotechar = "\x82@\x83", *fmt2, *textcolor = "\x80"; char *tempchar = NULL; + char color_prefix[2]; if (players[playernum].spectator) { @@ -760,7 +761,8 @@ static void Got_Saycmd(UINT8 **p, INT32 playernum) } else { - cstart = "\x80" + (K_SkincolorToTextColor(players[playernum].skincolor) >> V_CHARCOLORSHIFT); + sprintf(color_prefix, "%c", '\x80' + (K_SkincolorToTextColor(players[playernum].skincolor) >> V_CHARCOLORSHIFT)); + cstart = color_prefix; } prefix = cstart; diff --git a/src/k_kart.c b/src/k_kart.c index 58e8aa646..a9656ccff 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -10048,9 +10048,10 @@ static void K_drawKartNameTags(void) { bary += (vid.height - (BASEVIDHEIGHT * vid.dupy)) / 2; } - - V_DrawFill(barx, bary, barw, (3 * vid.dupy), colormap[31]|V_NOSCALESTART); - V_DrawFill(barx, bary + vid.dupy, barw, vid.dupy, colormap[0]|V_NOSCALESTART); + + // Lat: 10/06/2020: colormap can be NULL on the frame you join a game, just arbitrarily use palette indexes 31 and 0 instead of whatever the colormap would give us instead to avoid crashes. + V_DrawFill(barx, bary, barw, (3 * vid.dupy), (colormap ? colormap[31] : 31)|V_NOSCALESTART); + V_DrawFill(barx, bary + vid.dupy, barw, vid.dupy, (colormap ? colormap[0] : 0)|V_NOSCALESTART); // END DRAWFILL DUMBNESS // Draw the stem diff --git a/src/m_menu.c b/src/m_menu.c index a82f97314..96a9d352a 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -5494,7 +5494,11 @@ static void DrawReplayHutReplayInfo(void) } // Character face! - if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[0].skin].facewant) != LUMPERROR) + + // Lat: 08/06/2020: For some reason missing skins have their value set to 255 (don't even ask me why I didn't write this) + // and for an even STRANGER reason this passes the first check below, so we're going to make sure that the skin here ISN'T 255 before we do anything stupid. + + if (demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF && W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[0].skin].facewant) != LUMPERROR) { patch = facewantprefix[demolist[dir_on[menudepthleft]].standings[0].skin]; colormap = R_GetTranslationColormap( @@ -5692,7 +5696,11 @@ static void M_DrawReplayStartMenu(void) V_DrawString(BASEVIDWIDTH-92, STARTY + i*20 + 9, V_SNAPTOTOP, va("%d", demolist[dir_on[menudepthleft]].standings[i].timeorscore)); // Character face! - if (W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[i].skin].facerank) != LUMPERROR) + + // Lat: 08/06/2020: For some reason missing skins have their value set to 255 (don't even ask me why I didn't write this) + // and for an even STRANGER reason this passes the first check below, so we're going to make sure that the skin here ISN'T 255 before we do anything stupid. + + if (demolist[dir_on[menudepthleft]].standings[0].skin != 0xFF && W_CheckNumForName(skins[demolist[dir_on[menudepthleft]].standings[i].skin].facerank) != LUMPERROR) { patch = facerankprefix[demolist[dir_on[menudepthleft]].standings[i].skin]; colormap = R_GetTranslationColormap( diff --git a/src/p_user.c b/src/p_user.c index 657d45dda..fd5691601 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8235,8 +8235,8 @@ boolean P_SpectatorJoinGame(player_t *player) player->playerstate = PST_REBORN; //Reset away view - if (P_IsLocalPlayer(player) && g_localplayers[0] != consoleplayer) - g_localplayers[0] = consoleplayer; + if (P_IsLocalPlayer(player) && displayplayers[0] != consoleplayer) + displayplayers[0] = consoleplayer; HU_AddChatText(va(M_GetText("\x82*%s entered the game."), player_names[player-players]), false); return true; // no more player->mo, cannot continue. diff --git a/src/v_video.c b/src/v_video.c index 20931291f..0f6479205 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1909,7 +1909,6 @@ void V_DrawStringScaled( if (!( flags & V_SNAPTOLEFT )) { left = ( right - BASEVIDWIDTH )/ 2;/* left edge of drawable area */ - x = ( left << FRACBITS )+ x; right -= left; } }