Player duct walking sound fix

git-svn-id: https://svn.eduke32.com/eduke32@7726 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
terminx 2019-06-25 11:30:38 +00:00 committed by Christoph Oelckers
parent 86dcab958d
commit 876627136a

View file

@ -5275,42 +5275,45 @@ void P_ProcessInput(int playerNum)
{ {
int const checkWalkSound = sintable[pPlayer->bobcounter & 2047] >> 12; int const checkWalkSound = sintable[pPlayer->bobcounter & 2047] >> 12;
if ((trueFloorDist < PHEIGHT + ZOFFSET3) && (checkWalkSound == 1 || checkWalkSound == 3)) if (trueFloorDist < PHEIGHT + ZOFFSET3)
{ {
if (pPlayer->walking_snd_toggle == 0 && pPlayer->on_ground) if (checkWalkSound == 1 || checkWalkSound == 3)
{ {
switch (sectorLotag) if (pPlayer->walking_snd_toggle == 0 && pPlayer->on_ground)
{ {
case 0: switch (sectorLotag)
{ {
int const walkPicnum = (lowZhit >= 0 && (lowZhit & 49152) == 49152) case 0:
? TrackerCast(sprite[lowZhit & (MAXSPRITES - 1)].picnum)
: TrackerCast(sector[pPlayer->cursectnum].floorpicnum);
switch (DYNAMICTILEMAP(walkPicnum))
{ {
case PANNEL1__STATIC: int const walkPicnum = (lowZhit >= 0 && (lowZhit & 49152) == 49152)
case PANNEL2__STATIC: ? TrackerCast(sprite[lowZhit & (MAXSPRITES - 1)].picnum)
A_PlaySound(DUKE_WALKINDUCTS, pPlayer->i); : TrackerCast(sector[pPlayer->cursectnum].floorpicnum);
pPlayer->walking_snd_toggle = 1;
break;
}
}
break;
case ST_1_ABOVE_WATER: switch (DYNAMICTILEMAP(walkPicnum))
if (!pPlayer->spritebridge) {
{ case PANNEL1__STATIC:
if ((krand() & 1) == 0) case PANNEL2__STATIC:
A_PlaySound(DUKE_ONWATER, pPlayer->i); A_PlaySound(DUKE_WALKINDUCTS, pPlayer->i);
pPlayer->walking_snd_toggle = 1; pPlayer->walking_snd_toggle = 1;
break;
}
} }
break; break;
case ST_1_ABOVE_WATER:
if (!pPlayer->spritebridge)
{
if ((krand() & 1) == 0)
A_PlaySound(DUKE_ONWATER, pPlayer->i);
pPlayer->walking_snd_toggle = 1;
}
break;
}
} }
} }
else if (pPlayer->walking_snd_toggle > 0)
pPlayer->walking_snd_toggle--;
} }
else if (pPlayer->walking_snd_toggle > 0)
pPlayer->walking_snd_toggle--;
if (pPlayer->jetpack_on == 0 && pPlayer->inv_amount[GET_STEROIDS] > 0 && pPlayer->inv_amount[GET_STEROIDS] < 400) if (pPlayer->jetpack_on == 0 && pPlayer->inv_amount[GET_STEROIDS] > 0 && pPlayer->inv_amount[GET_STEROIDS] < 400)
velocityModifier <<= 1; velocityModifier <<= 1;