Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dino Bollinger
EDuke32 - DB Patches
Commits
764938c2
Commit
764938c2
authored
Jun 27, 2020
by
Dino Bollinger
Browse files
Revise previous commit because it was faulty
parent
8d56442a
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/duke3d/src/player.cpp
View file @
764938c2
...
...
@@ -3262,20 +3262,19 @@ void P_GetInput(int const playerNum)
localInput
.
extbits
|=
BUTTON
(
gamefunc_Turn_Right
)
<<
5
;
localInput
.
extbits
|=
BUTTON
(
gamefunc_Alt_Fire
)
<<
6
;
int
const
movementLocked
=
P_CheckLockedMovement
(
playerNum
);
if
(
(
ud
.
scrollmode
&&
ud
.
overhead_on
)
||
(
movementLocked
&
IL_NOTHING
)
==
IL_NOTHING
)
if
(
ud
.
scrollmode
&&
ud
.
overhead_on
)
{
if
(
ud
.
scrollmode
&&
ud
.
overhead_on
)
{
ud
.
folfvel
=
input
.
fvel
;
ud
.
folavel
=
fix16_to_int
(
input
.
q16avel
);
}
ud
.
folfvel
=
input
.
fvel
;
ud
.
folavel
=
fix16_to_int
(
input
.
q16avel
);
localInput
.
fvel
=
localInput
.
svel
=
0
;
localInput
.
q16avel
=
localInput
.
q16horz
=
0
;
}
else
{
int
const
movementLocked
=
P_CheckLockedMovement
(
playerNum
);
if
(
!
(
movementLocked
&
IL_NOMOVE
))
{
localInput
.
fvel
=
clamp
(
localInput
.
fvel
+
input
.
fvel
,
-
MAXVEL
,
MAXVEL
);
...
...
@@ -3287,11 +3286,10 @@ void P_GetInput(int const playerNum)
if
(
!
(
movementLocked
&
IL_NOHORIZ
))
pPlayer
->
q16horiz
=
fix16_clamp
(
fix16_sadd
(
pPlayer
->
q16horiz
,
input
.
q16horz
),
F16
(
HORIZ_MIN
),
F16
(
HORIZ_MAX
));
}
// Always update input struct such that movement can be used in scripts even when the player himself can't move
localInput
.
q16
horz
=
fix16_clamp
(
fix16_sadd
(
localInput
.
q16
horz
,
input
.
q16
horz
),
F16
(
-
MAXHORIZVEL
),
F16
(
MAXHORIZVEL
)
);
localInput
.
q16avel
=
fix16_sadd
(
localInput
.
q16avel
,
input
.
q16avel
);
localInput
.
q16horz
=
fix16_clamp
(
fix16_sadd
(
localInput
.
q16horz
,
input
.
q16horz
),
F16
(
-
MAXHORIZVEL
),
F16
(
MAXHORIZVEL
));
localInput
.
q16
avel
=
fix16_sadd
(
localInput
.
q16
avel
,
input
.
q16
avel
);
}
// A horiz diff of 128 equal 45 degrees, so we convert horiz to 1024 angle units
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment