mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Fixed: There's more than one place where the CROUCHABLEMORPH flag needs to be checked.
SVN r4228 (trunk)
This commit is contained in:
parent
3bbd255b73
commit
b845fdb5d5
2 changed files with 8 additions and 4 deletions
|
@ -426,6 +426,11 @@ public:
|
|||
crouching = 0;
|
||||
crouchviewdelta = 0;
|
||||
}
|
||||
|
||||
bool CanCrouch() const
|
||||
{
|
||||
return morphTics == 0 || mo->PlayerFlags & PPF_CROUCHABLEMORPH;
|
||||
}
|
||||
|
||||
int GetSpawnClass();
|
||||
};
|
||||
|
|
|
@ -539,7 +539,7 @@ void APlayerPawn::BeginPlay ()
|
|||
|
||||
void APlayerPawn::Tick()
|
||||
{
|
||||
if (player != NULL && player->mo == this && player->morphTics == 0 && player->playerstate != PST_DEAD)
|
||||
if (player != NULL && player->mo == this && player->CanCrouch() && player->playerstate != PST_DEAD)
|
||||
{
|
||||
height = FixedMul(GetDefault()->height, player->crouchfactor);
|
||||
}
|
||||
|
@ -1788,7 +1788,7 @@ void P_MovePlayer (player_t *player)
|
|||
sm = FixedMul (sm, player->mo->Speed);
|
||||
|
||||
// When crouching, speed and bobbing have to be reduced
|
||||
if (player->morphTics == 0 && player->crouchfactor != FRACUNIT)
|
||||
if (player->CanCrouch() && player->crouchfactor != FRACUNIT)
|
||||
{
|
||||
fm = FixedMul(fm, player->crouchfactor);
|
||||
sm = FixedMul(sm, player->crouchfactor);
|
||||
|
@ -2204,8 +2204,7 @@ void P_PlayerThink (player_t *player)
|
|||
{
|
||||
player->cmd.ucmd.buttons &= ~BT_CROUCH;
|
||||
}
|
||||
if ((player->morphTics == 0 || player->mo->PlayerFlags & PPF_CROUCHABLEMORPH)
|
||||
&& player->health > 0 && level.IsCrouchingAllowed())
|
||||
if (player->CanCrouch() && player->health > 0 && level.IsCrouchingAllowed())
|
||||
{
|
||||
if (!totallyfrozen)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue