- Added: PlayerPawn property "Player.ViewBob" which acts as a MoveBob/StillBob multiplier.

This commit is contained in:
raa-eruanna 2016-09-26 07:24:37 -04:00 committed by Christoph Oelckers
commit e0efdd97b3
5 changed files with 32 additions and 5 deletions

View file

@ -651,7 +651,8 @@ void APlayerPawn::Serialize(FSerializer &arc)
("fallingscreammaxn", FallingScreamMaxSpeed, def->FallingScreamMaxSpeed)
("userange", UseRange, def->UseRange)
("aircapacity", AirCapacity, def->AirCapacity)
("viewheight", ViewHeight, def->ViewHeight);
("viewheight", ViewHeight, def->ViewHeight)
("viewbob", ViewBob, def->ViewBob);
}
//===========================================================================
@ -1844,11 +1845,12 @@ void P_CalcHeight (player_t *player)
return;
}
//[SP] Added (x*player->mo->ViewBob) to allow DECORATE changes to view bobbing speed.
if (still)
{
if (player->health > 0)
{
angle = level.time / (120 * TICRATE / 35.) * 360.;
angle = level.time / (120 * TICRATE / 35.) * 360. * player->mo->ViewBob;
bob = player->userinfo.GetStillBob() * angle.Sin();
}
else
@ -1858,7 +1860,7 @@ void P_CalcHeight (player_t *player)
}
else
{
angle = level.time / (20 * TICRATE / 35.) * 360.;
angle = level.time / (20 * TICRATE / 35.) * 360. * player->mo->ViewBob;
bob = player->bob * angle.Sin() * (player->mo->waterlevel > 1 ? 0.25f : 0.5f);
}