Blood: Clear keys on new level, fixes #308

# Conflicts:
#	source/blood/src/player.h
This commit is contained in:
CommonLoon102 2020-02-10 06:23:49 +01:00 committed by Christoph Oelckers
parent 37f3bb37d4
commit 8d7d8cc930
3 changed files with 4 additions and 4 deletions

View File

@ -640,7 +640,7 @@ void StartLevel(GAMEOPTIONS *gameOptions)
}
playerInit(i,0);
}
playerStart(i);
playerStart(i, 1);
}
if (gameOptions->uGameFlags&1)
{

View File

@ -645,7 +645,7 @@ void playerResetPosture(PLAYER* pPlayer) {
memcpy(pPlayer->pPosture, gPostureDefaults, sizeof(gPostureDefaults));
}
void playerStart(int nPlayer)
void playerStart(int nPlayer, int bNewLevel)
{
PLAYER* pPlayer = &gPlayer[nPlayer];
GINPUT* pInput = &pPlayer->input;
@ -739,7 +739,7 @@ void playerStart(int nPlayer)
pPlayer->relAim.dz = 0;
pPlayer->aimTarget = -1;
pPlayer->zViewVel = pPlayer->zWeaponVel;
if (!(gGameOptions.nGameType == 1 && gGameOptions.bKeepKeysOnRespawn))
if (!(gGameOptions.nGameType == 1 && gGameOptions.bKeepKeysOnRespawn && !bNewLevel))
for (int i = 0; i < 8; i++)
pPlayer->hasKey[i] = gGameOptions.nGameType >= 2;
pPlayer->hasFlag = 0;

View File

@ -283,7 +283,7 @@ void playerSetRace(PLAYER *pPlayer, int nLifeMode);
void playerSetGodMode(PLAYER *pPlayer, char bGodMode);
void playerResetInertia(PLAYER *pPlayer);
void playerCorrectInertia(PLAYER *pPlayer, vec3_t const *oldpos);
void playerStart(int nPlayer);
void playerStart(int nPlayer, int bNewLevel = 0);
void playerReset(PLAYER *pPlayer);
void playerInit(int nPlayer, unsigned int a2);
char sub_3A158(PLAYER *a1, spritetype *a2);