mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-10 14:51:51 +00:00
- Added CROUCHABLEMORPH flag for the PlayerPawn class. Use this to indicate that a morphed
player class can crouch. (Regular players can always crouch, hence the name CROUCHABLEMORPH and not CANMORPH or ALLOWMORPH.) SVN r4221 (trunk)
This commit is contained in:
parent
a50e670c0c
commit
cb64014494
3 changed files with 6 additions and 3 deletions
|
@ -163,6 +163,7 @@ enum
|
|||
{
|
||||
PPF_NOTHRUSTWHENINVUL = 1, // Attacks do not thrust the player if they are invulnerable.
|
||||
PPF_CANSUPERMORPH = 2, // Being remorphed into this class can give you a Tome of Power
|
||||
PPF_CROUCHABLEMORPH = 4, // This morphed player can crouch
|
||||
};
|
||||
|
||||
//
|
||||
|
|
|
@ -2204,7 +2204,8 @@ void P_PlayerThink (player_t *player)
|
|||
{
|
||||
player->cmd.ucmd.buttons &= ~BT_CROUCH;
|
||||
}
|
||||
if (player->morphTics == 0 && player->health > 0 && level.IsCrouchingAllowed())
|
||||
if ((player->morphTics == 0 || player->mo->PlayerFlags & PPF_CROUCHABLEMORPH)
|
||||
&& player->health > 0 && level.IsCrouchingAllowed())
|
||||
{
|
||||
if (!totallyfrozen)
|
||||
{
|
||||
|
@ -2212,11 +2213,11 @@ void P_PlayerThink (player_t *player)
|
|||
|
||||
if (crouchdir == 0)
|
||||
{
|
||||
crouchdir = (player->cmd.ucmd.buttons & BT_CROUCH)? -1 : 1;
|
||||
crouchdir = (player->cmd.ucmd.buttons & BT_CROUCH) ? -1 : 1;
|
||||
}
|
||||
else if (player->cmd.ucmd.buttons & BT_CROUCH)
|
||||
{
|
||||
player->crouching=0;
|
||||
player->crouching = 0;
|
||||
}
|
||||
if (crouchdir == 1 && player->crouchfactor < FRACUNIT &&
|
||||
player->mo->z + player->mo->height < player->mo->ceilingz)
|
||||
|
|
|
@ -336,6 +336,7 @@ static FFlagDef PlayerPawnFlags[] =
|
|||
// PlayerPawn flags
|
||||
DEFINE_FLAG(PPF, NOTHRUSTWHENINVUL, APlayerPawn, PlayerFlags),
|
||||
DEFINE_FLAG(PPF, CANSUPERMORPH, APlayerPawn, PlayerFlags),
|
||||
DEFINE_FLAG(PPF, CROUCHABLEMORPH, APlayerPawn, PlayerFlags),
|
||||
};
|
||||
|
||||
static FFlagDef PowerSpeedFlags[] =
|
||||
|
|
Loading…
Reference in a new issue