diff --git a/source/duke3d/src/player.cpp b/source/duke3d/src/player.cpp index 9d71798e5..173ef9969 100644 --- a/source/duke3d/src/player.cpp +++ b/source/duke3d/src/player.cpp @@ -3931,8 +3931,6 @@ static void P_ProcessWeapon(int playerNum) // this event is deprecated VM_OnEvent(EVENT_FIREWEAPON, pPlayer->i, playerNum); - int spriteNum; - switch (PWEAPON(playerNum, pPlayer->curr_weapon, WorksLike)) { case HANDBOMB_WEAPON: @@ -3978,7 +3976,7 @@ static void P_ProcessWeapon(int playerNum) if (wall[hitData.wall].overpicnum == BIGFORCE) break; - spriteNum = headspritesect[hitData.sect]; + int spriteNum = headspritesect[hitData.sect]; while (spriteNum >= 0) { if (sprite[spriteNum].picnum == TRIPBOMB && klabs(sprite[spriteNum].z - hitData.pos.z) < ZOFFSET4 && diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index bc30621bd..109628f4d 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -269,11 +269,10 @@ static void G_PrecacheSprites(void) static void G_DoLoadScreen(const char *statustext, int32_t percent) { - int32_t i=0,j; - if (ud.recstat != 2) { - j = VM_OnEventWithReturn(EVENT_GETLOADTILE, g_player[screenpeek].ps->i, screenpeek, LOADSCREEN); + int32_t i = 0; + int32_t j = VM_OnEventWithReturn(EVENT_GETLOADTILE, g_player[screenpeek].ps->i, screenpeek, LOADSCREEN); //g_player[myconnectindex].ps->palette = palette; P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 @@ -344,7 +343,7 @@ static void G_DoLoadScreen(const char *statustext, int32_t percent) } /*Gv_SetVar(g_iReturnVarID,LOADSCREEN, -1, -1);*/ - j = VM_OnEventWithReturn(EVENT_GETLOADTILE, g_player[screenpeek].ps->i, screenpeek, LOADSCREEN); + int32_t j = VM_OnEventWithReturn(EVENT_GETLOADTILE, g_player[screenpeek].ps->i, screenpeek, LOADSCREEN); if ((uint32_t)j < 2*MAXTILES) { @@ -577,9 +576,7 @@ void P_RandomSpawnPoint(int playerNum) { DukePlayer_t *const pPlayer = g_player[playerNum].ps; - int32_t i = playerNum; - uint32_t dist; - uint32_t pdist = -1; + int32_t i = playerNum; if ((g_netServer || ud.multimode > 1) && !(g_gametypeFlags[ud.coop] & GAMETYPE_FIXEDRESPAWN)) { @@ -587,13 +584,14 @@ void P_RandomSpawnPoint(int playerNum) if (g_gametypeFlags[ud.coop] & GAMETYPE_TDMSPAWN) { + uint32_t pdist = -1; for (bssize_t j=0; jteam == pPlayer->team && sprite[g_player[j].ps->i].extra > 0) { for (bssize_t k=0; kpos.x - g_playerSpawnPoints[k].pos.x, + uint32_t dist = FindDistance2D(g_player[j].ps->pos.x - g_playerSpawnPoints[k].pos.x, g_player[j].ps->pos.y - g_playerSpawnPoints[k].pos.y); if (dist < pdist)