Commit 2e1092f5 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

Duke3d: fix compatibility with savegames made before...

Duke3d: fix compatibility with savegames made before 4fdd8dc8 and e8470bd2
parent 26bb86c1
......@@ -665,19 +665,15 @@ static inline void P_ResetTintFade(DukePlayer_t *const pPlayer)
pPlayer->pals.f = 0;
}
void P_ResetExtents(DukePlayer_t *const pPlayer)
void P_ResetOffsets(DukePlayer_t *const pPlayer)
{
pPlayer->autostep = 20 << 8;
pPlayer->autostep_sbw = 4 << 8;
pPlayer->floorzoffset = 40 << 8;
pPlayer->waterzoffset = 34 << 8;
pPlayer->minwaterzdist = 16 << 8;
pPlayer->shrunkzoffset = 12 << 8;
pPlayer->spritezoffset = 38 << 8 /*PHEIGHT*/;
pPlayer->clipdist = 164;
pPlayer->gravity = g_spriteGravity + 80;
pPlayer->runspeed = g_playerFriction;
pPlayer->gravity = g_spriteGravity + 80;
pPlayer->crouchzincrement = 2048 + 768;
pPlayer->crouchspeedmodifier = 8192;
......@@ -690,6 +686,16 @@ void P_ResetExtents(DukePlayer_t *const pPlayer)
pPlayer->jetpackzincrement = 2048;
}
void P_ResetExtents(DukePlayer_t* const pPlayer)
{
pPlayer->autostep = 20 << 8;
pPlayer->autostep_sbw = 4 << 8;
pPlayer->clipdist = 164;
pPlayer->runspeed = g_playerFriction;
P_ResetOffsets(pPlayer);
}
void P_ResetMultiPlayer(int playerNum)
{
auto &p = *g_player[playerNum].ps;
......
......@@ -41,8 +41,10 @@ void G_SetCrosshairColor(int32_t r,int32_t g,int32_t b);
void G_UpdateScreenArea(void);
void G_SetViewportShrink(int32_t dir);
void P_MoveToRandomSpawnPoint(int playerNum);
void P_ResetExtents(DukePlayer_t* const pPlayer);
void P_ResetInventory(int playerNum);
void P_ResetMultiPlayer(int playerNum);
void P_ResetOffsets(DukePlayer_t* const pPlayer);
void P_ResetPlayer(int playerNum);
void P_ResetWeapons(int playerNum);
void G_ClearFIFO(void);
......
......@@ -2520,7 +2520,12 @@ static void postloadplayer(int32_t savegamep)
//7
for (i=0; i<MAXPLAYERS; i++)
{
if (g_player[i].ps->gravity == 0 && g_player[i].ps->floorzoffset == 0)
P_ResetOffsets(g_player[i].ps);
g_player[i].playerquitflag = 1;
}
// ----------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment