mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 15:22:15 +00:00
- fixed: CF_FLY cannot be part of the player_t structure and be tracked properly. It needs to be part of the actor itself that has MF2_FLY set so it got moved to flags7.
- removed some fudging code that tried to work around the shortcomings of CF_FLY but was ultimately causing more problems than it solved.
This commit is contained in:
parent
c0eb39ec72
commit
337682934c
6 changed files with 8 additions and 14 deletions
|
@ -353,6 +353,7 @@ enum
|
|||
MF7_HITTARGET = 0x00004000, // The actor the projectile dies on is set to target, provided it's targetable anyway.
|
||||
MF7_HITMASTER = 0x00008000, // Same as HITTARGET, except it's master instead of target.
|
||||
MF7_HITTRACER = 0x00010000, // Same as HITTARGET, but for tracer.
|
||||
MF7_FLYCHEAT = 0x00020000, // must be part of the actor so that it can be tracked properly
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -1235,15 +1235,6 @@ void G_FinishTravel ()
|
|||
pawn->AddToHash ();
|
||||
pawn->SetState(pawn->SpawnState);
|
||||
pawn->player->SendPitchLimits();
|
||||
// Sync the FLY flags.
|
||||
if (pawn->flags2 & MF2_FLY)
|
||||
{
|
||||
pawn->player->cheats |= CF_FLY;
|
||||
}
|
||||
else
|
||||
{
|
||||
pawn->player->cheats &= ~CF_FLY;
|
||||
}
|
||||
|
||||
for (inv = pawn->Inventory; inv != NULL; inv = inv->Inventory)
|
||||
{
|
||||
|
|
|
@ -997,7 +997,8 @@ void APowerFlight::EndEffect ()
|
|||
{
|
||||
return;
|
||||
}
|
||||
if (!(Owner->player->cheats & CF_FLY))
|
||||
|
||||
if (!(Owner->flags7 & MF7_FLYCHEAT))
|
||||
{
|
||||
if (Owner->z != Owner->floorz)
|
||||
{
|
||||
|
|
|
@ -149,8 +149,7 @@ void cht_DoCheat (player_t *player, int cheat)
|
|||
case CHT_FLY:
|
||||
if (player->mo != NULL)
|
||||
{
|
||||
player->cheats ^= CF_FLY;
|
||||
if (player->cheats & CF_FLY)
|
||||
if ((player->mo->flags7 ^= MF7_FLYCHEAT) != 0)
|
||||
{
|
||||
player->mo->flags |= MF_NOGRAVITY;
|
||||
player->mo->flags2 |= MF2_FLY;
|
||||
|
|
|
@ -2800,7 +2800,7 @@ FUNC(LS_SetPlayerProperty)
|
|||
mask = CF_INSTANTWEAPSWITCH;
|
||||
break;
|
||||
case PROP_FLY:
|
||||
mask = CF_FLY;
|
||||
//mask = CF_FLY;
|
||||
break;
|
||||
case PROP_TOTALLYFROZEN:
|
||||
mask = CF_TOTALLYFROZEN;
|
||||
|
@ -2814,6 +2814,7 @@ FUNC(LS_SetPlayerProperty)
|
|||
it->player->cheats |= mask;
|
||||
if (arg2 == PROP_FLY)
|
||||
{
|
||||
it->flags7 |= MF7_FLYCHEAT;
|
||||
it->flags2 |= MF2_FLY;
|
||||
it->flags |= MF_NOGRAVITY;
|
||||
}
|
||||
|
@ -2823,6 +2824,7 @@ FUNC(LS_SetPlayerProperty)
|
|||
it->player->cheats &= ~mask;
|
||||
if (arg2 == PROP_FLY)
|
||||
{
|
||||
it->flags7 &= ~MF7_FLYCHEAT;
|
||||
it->flags2 &= ~MF2_FLY;
|
||||
it->flags &= ~MF_NOGRAVITY;
|
||||
}
|
||||
|
|
|
@ -4477,7 +4477,7 @@ APlayerPawn *P_SpawnPlayer (FPlayerStart *mthing, int playernum, int flags)
|
|||
p->mo->ResetAirSupply(false);
|
||||
p->Uncrouch();
|
||||
p->MinPitch = p->MaxPitch = 0; // will be filled in by PostBeginPlay()/netcode
|
||||
p->cheats &= ~CF_FLY;
|
||||
|
||||
|
||||
p->velx = p->vely = 0; // killough 10/98: initialize bobbing to 0.
|
||||
|
||||
|
|
Loading…
Reference in a new issue