diff --git a/src/d_main.c b/src/d_main.c index bad78c530..bf6c62ef2 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -679,13 +679,13 @@ static void D_Display(void) s[sizeof s - 1] = '\0'; snprintf(s, sizeof s - 1, "get %d b/s", getbps); - V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-40, V_YELLOWMAP, s); + V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-40, V_YELLOWMAP, s); snprintf(s, sizeof s - 1, "send %d b/s", sendbps); - V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-30, V_YELLOWMAP, s); + V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-30, V_YELLOWMAP, s); snprintf(s, sizeof s - 1, "GameMiss %.2f%%", gamelostpercent); - V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-20, V_YELLOWMAP, s); + V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-20, V_YELLOWMAP, s); snprintf(s, sizeof s - 1, "SysMiss %.2f%%", lostpercent); - V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-ST_HEIGHT-10, V_YELLOWMAP, s); + V_DrawRightAlignedString(BASEVIDWIDTH, BASEVIDHEIGHT-10, V_YELLOWMAP, s); } if (cv_perfstats.value) diff --git a/src/dedicated/i_system.c b/src/dedicated/i_system.c index 82dd51be0..1a1db8fb3 100644 --- a/src/dedicated/i_system.c +++ b/src/dedicated/i_system.c @@ -1390,8 +1390,8 @@ static const char *searchWad(const char *searchDir) #define CHECKWADPATH(ret) \ do { \ - I_OutputMsg(",%s", returnWadPath); \ - if (isWadPathOk(returnWadPath)) \ + I_OutputMsg(",%s", ret); \ + if (isWadPathOk(ret)) \ return ret; \ } while (0) @@ -1416,7 +1416,9 @@ static const char *locateWad(void) #ifndef NOCWD // examine current dir strcpy(returnWadPath, "."); - CHECKWADPATH(NULL); + I_OutputMsg(",%s", returnWadPath); + if (isWadPathOk(returnWadPath)) + return NULL; #endif #ifdef __APPLE__ @@ -1433,13 +1435,13 @@ static const char *locateWad(void) #ifndef NOHOME // find in $HOME - I_OutputMsg(",HOME/" DEFAULTDIR); if ((envstr = I_GetEnv("HOME")) != NULL) { - char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR)); + char *tmp = malloc(strlen(envstr) + 1 + sizeof(DEFAULTDIR)); strcpy(tmp, envstr); + strcat(tmp, "/"); strcat(tmp, DEFAULTDIR); - SEARCHWAD(envstr); + CHECKWADPATH(tmp); free(tmp); } #endif diff --git a/src/g_game.c b/src/g_game.c index bf369d111..5d6954b9b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -3352,7 +3352,7 @@ void G_AddPlayer(INT32 playernum) p->playerstate = PST_REBORN; - p->height = mobjinfo[MT_PLAYER].height; + p->height = skins[p->skin]->height; if (G_GametypeUsesLives() || ((netgame || multiplayer) && (gametyperules & GTR_FRIENDLY))) p->lives = cv_startinglives.value; diff --git a/src/hu_stuff.c b/src/hu_stuff.c index a69ae23e1..085fddc43 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -29,7 +29,7 @@ #include "i_video.h" #include "i_system.h" -#include "st_stuff.h" // ST_HEIGHT +#include "st_stuff.h" #include "r_local.h" #include "keys.h" @@ -1226,7 +1226,7 @@ static void HU_drawMiniChat(void) for (size_t i = chat_nummsg_min; i > 0; i--) { - char *msg = V_ChatWordWrap(0, boxw-charwidth, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE|V_MONOSPACE, chat_mini[i-1]); + char *msg = V_ChatWordWrap(0, boxw-charwidth-2, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE|V_MONOSPACE, chat_mini[i-1]); for(size_t j = 0; msg[j]; j++) // iterate through msg { if (msg[j] == '\n') // get back down. @@ -1266,7 +1266,7 @@ static void HU_drawMiniChat(void) { INT32 timer = ((cv_chattime.value*TICRATE)-chat_timers[i]) - cv_chattime.value*TICRATE+9; // see below... INT32 transflag = (timer >= 0 && timer <= 9) ? (timer*V_10TRANS) : 0; // you can make bad jokes out of this one. - char *msg = V_ChatWordWrap(0, boxw-charwidth, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE|V_MONOSPACE, chat_mini[i]); // get the current message, and word wrap it. + char *msg = V_ChatWordWrap(0, boxw-charwidth-2, V_SNAPTOBOTTOM|V_SNAPTOLEFT|V_ALLOWLOWERCASE|V_MONOSPACE, chat_mini[i]); // get the current message, and word wrap it. UINT8 *colormap = NULL; for(size_t j = 0; msg[j]; j++) // iterate through msg @@ -1354,7 +1354,7 @@ static void HU_drawChatLog(INT32 offset) for (i=0; i= end_p) BADSAVE // Reads the save file to list lives, level, player, etc. @@ -8999,10 +9010,11 @@ static void M_ReadSavegameInfo(UINT32 slot) CHECKPOS READSTRINGN(sav_p, ourSkinName, SKINNAMESIZE); savegameinfo[slot].skinnum = R_SkinAvailable(ourSkinName); + STRBUFCPY(savegameinfo[slot].skinname, ourSkinName); if (savegameinfo[slot].skinnum >= numskins || !R_SkinUsable(-1, savegameinfo[slot].skinnum)) - BADSAVE + MISSING CHECKPOS READSTRINGN(sav_p, botSkinName, SKINNAMESIZE); @@ -9010,7 +9022,7 @@ static void M_ReadSavegameInfo(UINT32 slot) if (savegameinfo[slot].botskin-1 >= numskins || !R_SkinUsable(-1, savegameinfo[slot].botskin-1)) - BADSAVE + MISSING } CHECKPOS @@ -9055,6 +9067,7 @@ static void M_ReadSavegameInfo(UINT32 slot) } #undef CHECKPOS #undef BADSAVE +#undef MISSING // // M_ReadSaveStrings diff --git a/src/m_menu.h b/src/m_menu.h index 55c0b4060..e76010c17 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -422,6 +422,7 @@ typedef struct { char levelname[32]; UINT8 skinnum; + char skinname [SKINNAMESIZE+1]; UINT8 botskin; UINT8 numemeralds; UINT8 numgameovers; diff --git a/src/netcode/d_clisrv.c b/src/netcode/d_clisrv.c index 03668d0f0..c52ea48da 100644 --- a/src/netcode/d_clisrv.c +++ b/src/netcode/d_clisrv.c @@ -1363,16 +1363,16 @@ static void IdleUpdate(void) if (!server || !netgame) return; - for (i = 1; i < MAXPLAYERS; i++) + for (i = 0; i < MAXPLAYERS; i++) { - if (cv_idletime.value && playeringame[i] && playernode[i] != UINT8_MAX && !players[i].quittime && !players[i].spectator && !players[i].bot && !IsPlayerAdmin(i) && i != serverplayer && gamestate == GS_LEVEL && !(players[i].pflags & PF_FINISHED)) + if (playeringame[i] && playernode[i] != UINT8_MAX && !players[i].quittime && !players[i].spectator && !players[i].bot && gamestate == GS_LEVEL) { if (players[i].cmd.forwardmove || players[i].cmd.sidemove || players[i].cmd.buttons) players[i].lastinputtime = 0; else players[i].lastinputtime++; - if (players[i].lastinputtime > (tic_t)cv_idletime.value * TICRATE * 60) + if (cv_idletime.value && !IsPlayerAdmin(i) && i != serverplayer && !(players[i].pflags & PF_FINISHED) && players[i].lastinputtime > (tic_t)cv_idletime.value * TICRATE * 60) { players[i].lastinputtime = 0; if (cv_idleaction.value == 2 && G_GametypeHasSpectators()) diff --git a/src/p_map.c b/src/p_map.c index b8584205b..b79f9d45c 100644 --- a/src/p_map.c +++ b/src/p_map.c @@ -2502,6 +2502,9 @@ boolean P_TryCameraMove(fixed_t x, fixed_t y, camera_t *thiscam) floatok = false; + if (dedicated) // this crashes so don't even try it + return false; + if (twodlevel || (thiscam == &camera && players[displayplayer].mo && (players[displayplayer].mo->flags2 & MF2_TWOD)) || (thiscam == &camera2 && players[secondarydisplayplayer].mo && (players[secondarydisplayplayer].mo->flags2 & MF2_TWOD))) diff --git a/src/p_user.c b/src/p_user.c index ea68f9443..3ee13aca9 100644 --- a/src/p_user.c +++ b/src/p_user.c @@ -8829,6 +8829,8 @@ void P_MovePlayer(player_t *player) player->mo->height = P_GetPlayerSpinHeight(player); atspinheight = true; } + else if (player->powers[pw_carry] == CR_PLAYER || player->powers[pw_carry] == CR_PTERABYTE) // You're slightly shorter while being carried + player->mo->height = FixedDiv(P_GetPlayerHeight(player), FixedDiv(14*FRACUNIT,10*FRACUNIT)); else player->mo->height = P_GetPlayerHeight(player); @@ -12850,9 +12852,9 @@ void P_PlayerAfterThink(player_t *player) else { if (tails->player) - P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->player->drawangle, 4*FRACUNIT), tails->y + P_ReturnThrustY(tails, tails->player->drawangle, 4*FRACUNIT), true); + P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->player->drawangle, 4*tails->scale), tails->y + P_ReturnThrustY(tails, tails->player->drawangle, 4*tails->scale), true); else - P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->angle, 4*FRACUNIT), tails->y + P_ReturnThrustY(tails, tails->angle, 4*FRACUNIT), true); + P_TryMove(player->mo, tails->x + P_ReturnThrustX(tails, tails->angle, 4*tails->scale), tails->y + P_ReturnThrustY(tails, tails->angle, 4*tails->scale), true); player->mo->momx = tails->momx; player->mo->momy = tails->momy; player->mo->momz = tails->momz; @@ -12866,7 +12868,7 @@ void P_PlayerAfterThink(player_t *player) P_SetPlayerAngle(player, player->mo->angle); } - if (P_AproxDistance(player->mo->x - tails->x, player->mo->y - tails->y) > player->mo->radius) + if (P_AproxDistance(player->mo->x - tails->x, player->mo->y - tails->y) > tails->radius) player->powers[pw_carry] = CR_NONE; if (player->powers[pw_carry] == CR_PLAYER) @@ -13087,7 +13089,7 @@ void P_PlayerAfterThink(player_t *player) player->mo->momy = ptera->momy; player->mo->momz = ptera->momz; - if (P_AproxDistance(player->mo->x - ptera->x - ptera->watertop, player->mo->y - ptera->y - ptera->waterbottom) > player->mo->radius) + if (P_AproxDistance(player->mo->x - ptera->x - ptera->watertop, player->mo->y - ptera->y - ptera->waterbottom) > ptera->radius) goto dropoff; ptera->watertop >>= 1; diff --git a/src/r_draw.c b/src/r_draw.c index feb4693bb..eca3f36b7 100644 --- a/src/r_draw.c +++ b/src/r_draw.c @@ -19,7 +19,6 @@ #include "doomstat.h" #include "r_local.h" #include "r_translation.h" -#include "st_stuff.h" // need ST_HEIGHT #include "i_video.h" #include "v_video.h" #include "m_misc.h" diff --git a/src/screen.h b/src/screen.h index e23e8cbd6..375b3e04e 100644 --- a/src/screen.h +++ b/src/screen.h @@ -30,10 +30,6 @@ #define NUMSCREENS 5 #endif -// Size of statusbar. -#define ST_HEIGHT 32 -#define ST_WIDTH 320 - // used now as a maximum video mode size for extra vesa modes. // we try to re-allocate a minimum of buffers for stability of the memory, diff --git a/src/sdl/i_system.c b/src/sdl/i_system.c index e28fbd34a..9fe50a6a2 100644 --- a/src/sdl/i_system.c +++ b/src/sdl/i_system.c @@ -3003,8 +3003,8 @@ static const char *searchWad(const char *searchDir) #define CHECKWADPATH(ret) \ do { \ - I_OutputMsg(",%s", returnWadPath); \ - if (isWadPathOk(returnWadPath)) \ + I_OutputMsg(",%s", ret); \ + if (isWadPathOk(ret)) \ return ret; \ } while (0) @@ -3033,7 +3033,9 @@ static const char *locateWad(void) #ifndef NOCWD // examine current dir strcpy(returnWadPath, "."); - CHECKWADPATH(NULL); + I_OutputMsg(",%s", returnWadPath); + if (isWadPathOk(returnWadPath)) + return NULL; #endif #ifdef __APPLE__ @@ -3053,10 +3055,11 @@ static const char *locateWad(void) I_OutputMsg(",HOME/" DEFAULTDIR); if ((envstr = I_GetEnv("HOME")) != NULL) { - char *tmp = malloc(strlen(envstr) + sizeof(DEFAULTDIR)); + char *tmp = malloc(strlen(envstr) + 1 + sizeof(DEFAULTDIR)); strcpy(tmp, envstr); + strcat(tmp, "/"); strcat(tmp, DEFAULTDIR); - SEARCHWAD(envstr); + CHECKWADPATH(tmp); free(tmp); } #endif