mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-27 06:02:18 +00:00
This commit is contained in:
commit
3ea27cd996
5 changed files with 13 additions and 6 deletions
|
@ -150,6 +150,7 @@ public:
|
|||
int MugShotMaxHealth;
|
||||
int RunHealth;
|
||||
int PlayerFlags;
|
||||
double FullHeight;
|
||||
TObjPtr<AInventory> InvFirst; // first inventory item displayed on inventory bar
|
||||
TObjPtr<AInventory> InvSel; // selected inventory item
|
||||
|
||||
|
|
|
@ -6906,6 +6906,10 @@ DEFINE_ACTION_FUNCTION(AActor, A_SetSize)
|
|||
self->LinkToWorld(&ctx);
|
||||
ACTION_RETURN_BOOL(false);
|
||||
}
|
||||
if (self->player && self->player->mo == self)
|
||||
{
|
||||
self->player->mo->FullHeight = newheight;
|
||||
}
|
||||
|
||||
ACTION_RETURN_BOOL(true);
|
||||
}
|
||||
|
|
|
@ -689,7 +689,8 @@ void APlayerPawn::Serialize(FSerializer &arc)
|
|||
("userange", UseRange, def->UseRange)
|
||||
("aircapacity", AirCapacity, def->AirCapacity)
|
||||
("viewheight", ViewHeight, def->ViewHeight)
|
||||
("viewbob", ViewBob, def->ViewBob);
|
||||
("viewbob", ViewBob, def->ViewBob)
|
||||
("fullheight", FullHeight, def->FullHeight);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
|
@ -714,7 +715,7 @@ void APlayerPawn::BeginPlay ()
|
|||
{
|
||||
Super::BeginPlay ();
|
||||
ChangeStatNum (STAT_PLAYER);
|
||||
|
||||
FullHeight = Height;
|
||||
// Check whether a PWADs normal sprite is to be combined with the base WADs
|
||||
// crouch sprite. In such a case the sprites normally don't match and it is
|
||||
// best to disable the crouch sprite.
|
||||
|
@ -766,11 +767,11 @@ void APlayerPawn::Tick()
|
|||
{
|
||||
if (player != NULL && player->mo == this && player->CanCrouch() && player->playerstate != PST_DEAD)
|
||||
{
|
||||
Height = GetDefault()->Height * player->crouchfactor;
|
||||
Height = FullHeight * player->crouchfactor;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (health > 0) Height = GetDefault()->Height;
|
||||
if (health > 0) Height = FullHeight;
|
||||
}
|
||||
Super::Tick();
|
||||
}
|
||||
|
@ -2310,7 +2311,7 @@ void P_DeathThink (player_t *player)
|
|||
|
||||
void P_CrouchMove(player_t * player, int direction)
|
||||
{
|
||||
double defaultheight = player->mo->GetDefault()->Height;
|
||||
double defaultheight = player->mo->FullHeight;
|
||||
double savedheight = player->mo->Height;
|
||||
double crouchspeed = direction * CROUCHSPEED;
|
||||
double oldheight = player->viewheight;
|
||||
|
@ -3246,6 +3247,7 @@ DEFINE_FIELD(APlayerPawn, AirCapacity)
|
|||
DEFINE_FIELD(APlayerPawn, FlechetteType)
|
||||
DEFINE_FIELD(APlayerPawn, DamageFade)
|
||||
DEFINE_FIELD(APlayerPawn, ViewBob)
|
||||
DEFINE_FIELD(APlayerPawn, FullHeight)
|
||||
|
||||
DEFINE_FIELD(PClassPlayerPawn, HealingRadiusType)
|
||||
DEFINE_FIELD(PClassPlayerPawn, DisplayName)
|
||||
|
|
|
@ -1036,7 +1036,6 @@ bool ZCCCompiler::CompileFields(PStruct *type, TArray<ZCC_VarDeclarator *> &Fiel
|
|||
{
|
||||
auto field = Fields[0];
|
||||
FieldDesc *fd = nullptr;
|
||||
FString str = FName(field->Names[0].Name).GetChars();
|
||||
|
||||
PType *fieldtype = DetermineType(type, field, field->Names->Name, field->Type, true, true);
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@ class PlayerPawn : Actor native
|
|||
native Class<Actor> FlechetteType;
|
||||
native color DamageFade; // [CW] Fades for when you are being damaged.
|
||||
native double ViewBob; // [SP] ViewBob Multiplier
|
||||
native double FullHeight;
|
||||
|
||||
Default
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue