mirror of
https://github.com/ZDoom/qzdoom.git
synced 2025-01-18 15:11:46 +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
|
@ -427,6 +427,11 @@ public:
|
||||||
crouchviewdelta = 0;
|
crouchviewdelta = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool CanCrouch() const
|
||||||
|
{
|
||||||
|
return morphTics == 0 || mo->PlayerFlags & PPF_CROUCHABLEMORPH;
|
||||||
|
}
|
||||||
|
|
||||||
int GetSpawnClass();
|
int GetSpawnClass();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -539,7 +539,7 @@ void APlayerPawn::BeginPlay ()
|
||||||
|
|
||||||
void APlayerPawn::Tick()
|
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);
|
height = FixedMul(GetDefault()->height, player->crouchfactor);
|
||||||
}
|
}
|
||||||
|
@ -1788,7 +1788,7 @@ void P_MovePlayer (player_t *player)
|
||||||
sm = FixedMul (sm, player->mo->Speed);
|
sm = FixedMul (sm, player->mo->Speed);
|
||||||
|
|
||||||
// When crouching, speed and bobbing have to be reduced
|
// 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);
|
fm = FixedMul(fm, player->crouchfactor);
|
||||||
sm = FixedMul(sm, player->crouchfactor);
|
sm = FixedMul(sm, player->crouchfactor);
|
||||||
|
@ -2204,8 +2204,7 @@ void P_PlayerThink (player_t *player)
|
||||||
{
|
{
|
||||||
player->cmd.ucmd.buttons &= ~BT_CROUCH;
|
player->cmd.ucmd.buttons &= ~BT_CROUCH;
|
||||||
}
|
}
|
||||||
if ((player->morphTics == 0 || player->mo->PlayerFlags & PPF_CROUCHABLEMORPH)
|
if (player->CanCrouch() && player->health > 0 && level.IsCrouchingAllowed())
|
||||||
&& player->health > 0 && level.IsCrouchingAllowed())
|
|
||||||
{
|
{
|
||||||
if (!totallyfrozen)
|
if (!totallyfrozen)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue