mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-26 22:11:43 +00:00
- Fixed: The MAPINFO flags that control jumping, crouching, and freelook,
rather than overriding the dmflags values, actually overwrote the dmflags values, so they would continue to be in effect on later maps that didn't explicitly specify them. SVN r595 (trunk)
This commit is contained in:
parent
acbe3a191e
commit
f618134f15
9 changed files with 43 additions and 25 deletions
|
@ -1,4 +1,8 @@
|
|||
December 10, 2007
|
||||
- Fixed: The MAPINFO flags that control jumping, crouching, and freelook,
|
||||
rather than overriding the dmflags values, actually overwrote the dmflags
|
||||
values, so they would continue to be in effect on later maps that didn't
|
||||
explicitly specify them.
|
||||
- Fixed: Redefining a decal did not rebind any old references to the decal, so
|
||||
they would be left pointing at invalid data.
|
||||
- Fixed some more GCC warnings.
|
||||
|
|
|
@ -647,7 +647,7 @@ void G_AddViewPitch (int look)
|
|||
return;
|
||||
}
|
||||
look <<= 16;
|
||||
if (dmflags & DF_NO_FREELOOK)
|
||||
if (!level.IsFreelookAllowed())
|
||||
{
|
||||
LocalViewPitch = 0;
|
||||
}
|
||||
|
|
|
@ -2328,28 +2328,38 @@ void G_InitLevelLocals ()
|
|||
level.levelnum = 1;
|
||||
}
|
||||
|
||||
int clear = 0, set = 0;
|
||||
|
||||
if (level.flags & LEVEL_JUMP_YES)
|
||||
clear = DF_NO_JUMP;
|
||||
if (level.flags & LEVEL_JUMP_NO)
|
||||
set = DF_NO_JUMP;
|
||||
if (level.flags & LEVEL_CROUCH_YES)
|
||||
clear |= DF_NO_CROUCH;
|
||||
if (level.flags & LEVEL_CROUCH_NO)
|
||||
set |= DF_NO_CROUCH;
|
||||
if (level.flags & LEVEL_FREELOOK_YES)
|
||||
clear |= DF_NO_FREELOOK;
|
||||
if (level.flags & LEVEL_FREELOOK_NO)
|
||||
set |= DF_NO_FREELOOK;
|
||||
|
||||
dmflags = (dmflags & ~clear) | set;
|
||||
|
||||
compatflags.Callback();
|
||||
|
||||
NormalLight.ChangeFade (level.fadeto);
|
||||
}
|
||||
|
||||
bool level_locals_s::IsJumpingAllowed() const
|
||||
{
|
||||
if (level.flags & LEVEL_JUMP_NO)
|
||||
return false;
|
||||
if (level.flags & LEVEL_JUMP_YES)
|
||||
return true;
|
||||
return !(dmflags & DF_NO_JUMP);
|
||||
}
|
||||
|
||||
bool level_locals_s::IsCrouchingAllowed() const
|
||||
{
|
||||
if (level.flags & LEVEL_CROUCH_NO)
|
||||
return false;
|
||||
if (level.flags & LEVEL_CROUCH_YES)
|
||||
return true;
|
||||
return !(dmflags & DF_NO_CROUCH);
|
||||
}
|
||||
|
||||
bool level_locals_s::IsFreelookAllowed() const
|
||||
{
|
||||
if (level.flags & LEVEL_FREELOOK_NO)
|
||||
return false;
|
||||
if (level.flags & LEVEL_FREELOOK_YES)
|
||||
return true;
|
||||
return !(dmflags & DF_NO_FREELOOK);
|
||||
}
|
||||
|
||||
char *CalcMapName (int episode, int level)
|
||||
{
|
||||
static char lumpname[9];
|
||||
|
|
|
@ -241,6 +241,10 @@ struct level_locals_s
|
|||
SBYTE WallHorizLight;
|
||||
|
||||
const char *f1;
|
||||
|
||||
bool IsJumpingAllowed() const;
|
||||
bool IsCrouchingAllowed() const;
|
||||
bool IsFreelookAllowed() const;
|
||||
};
|
||||
typedef struct level_locals_s level_locals_t;
|
||||
|
||||
|
|
|
@ -2698,7 +2698,7 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, fixed_t vr
|
|||
// can't shoot outside view angles
|
||||
if (vrange == 0)
|
||||
{
|
||||
if (t1->player == NULL || dmflags & DF_NO_FREELOOK)
|
||||
if (t1->player == NULL || !level.IsFreelookAllowed())
|
||||
{
|
||||
vrange = ANGLE_1*35;
|
||||
}
|
||||
|
|
|
@ -4617,7 +4617,7 @@ AActor *P_SpawnPlayerMissile (AActor *source, fixed_t x, fixed_t y, fixed_t z,
|
|||
pitch = P_AimLineAttack (source, an, 16*64*FRACUNIT);
|
||||
|
||||
if (source->player != NULL &&
|
||||
!(dmflags & DF_NO_FREELOOK) &&
|
||||
level.IsFreelookAllowed() &&
|
||||
source->player->userinfo.aimdist <= ANGLE_1/2)
|
||||
{
|
||||
break;
|
||||
|
|
|
@ -646,7 +646,7 @@ void P_BulletSlope (AActor *mo)
|
|||
bulletpitch = P_AimLineAttack (mo, an, 16*64*FRACUNIT);
|
||||
|
||||
if (mo->player != NULL &&
|
||||
!(dmflags & DF_NO_FREELOOK) &&
|
||||
level.IsFreelookAllowed() &&
|
||||
mo->player->userinfo.aimdist <= ANGLE_1/2)
|
||||
{
|
||||
break;
|
||||
|
|
|
@ -1954,7 +1954,7 @@ void P_PlayerThink (player_t *player)
|
|||
|
||||
// Handle crouching
|
||||
if (player->cmd.ucmd.buttons & BT_JUMP) player->cmd.ucmd.buttons &= ~BT_DUCK;
|
||||
if (player->morphTics == 0 && player->health > 0 && !(dmflags & DF_NO_CROUCH))
|
||||
if (player->morphTics == 0 && player->health > 0 && level.IsCrouchingAllowed())
|
||||
{
|
||||
if (!(player->cheats & CF_TOTALLYFROZEN))
|
||||
{
|
||||
|
@ -2003,7 +2003,7 @@ void P_PlayerThink (player_t *player)
|
|||
}
|
||||
|
||||
// [RH] Look up/down stuff
|
||||
if (dmflags & DF_NO_FREELOOK)
|
||||
if (!level.IsFreelookAllowed())
|
||||
{
|
||||
player->mo->pitch = 0;
|
||||
}
|
||||
|
@ -2070,7 +2070,7 @@ void P_PlayerThink (player_t *player)
|
|||
{
|
||||
player->mo->momz = 3*FRACUNIT;
|
||||
}
|
||||
else if (!(dmflags & DF_NO_JUMP) && onground && !player->jumpTics)
|
||||
else if (level.IsJumpingAllowed() && onground && !player->jumpTics)
|
||||
{
|
||||
fixed_t jumpmomz = player->mo->JumpZ * 35 / TICRATE;
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ void R_InitSkyMap ()
|
|||
{
|
||||
skytexturemid = r_Yaspect/2*FRACUNIT;
|
||||
skystretch = (r_stretchsky
|
||||
&& !(dmflags & DF_NO_FREELOOK)
|
||||
&& level.IsFreelookAllowed()
|
||||
&& !(level.flags & LEVEL_FORCENOSKYSTRETCH)) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue