Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
49667689
Commit
49667689
authored
5 years ago
by
Nev3r
Browse files
Options
Downloads
Patches
Plain Diff
Provide a fix for "non-sloped" slopes launch/land behavior by checking the normal's components.
parent
a6926e33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!718
Rename R_IsPointInSubsector to R_PointInSubsectorOrNull/Nil
,
!634
Provide a fix for "non-sloped" slopes launch/land behavior by checking the normal's components.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/p_slopes.c
+6
-5
6 additions, 5 deletions
src/p_slopes.c
with
6 additions
and
5 deletions
src/p_slopes.c
+
6
−
5
View file @
49667689
...
...
@@ -50,10 +50,10 @@ static void ReconfigureViaVertexes (pslope_t *slope, const vector3_t v1, const v
// Set some defaults for a non-sloped "slope"
if
(
vec1
.
z
==
0
&&
vec2
.
z
==
0
)
{
/// \todo Fix fully flat cases.
slope
->
zangle
=
slope
->
xydirection
=
0
;
slope
->
zdelta
=
slope
->
d
.
x
=
slope
->
d
.
y
=
0
;
slope
->
normal
.
x
=
slope
->
normal
.
y
=
0
;
slope
->
normal
.
z
=
FRACUNIT
;
}
else
{
...
...
@@ -653,7 +653,9 @@ void P_ReverseQuantizeMomentumToSlope(vector3_t *momentum, pslope_t *slope)
// Handles slope ejection for objects
void
P_SlopeLaunch
(
mobj_t
*
mo
)
{
if
(
!
(
mo
->
standingslope
->
flags
&
SL_NOPHYSICS
))
// If there's physics, time for launching.
if
(
!
(
mo
->
standingslope
->
flags
&
SL_NOPHYSICS
)
// If there's physics, time for launching.
&&
(
mo
->
standingslope
->
normal
.
x
!=
0
||
mo
->
standingslope
->
normal
.
y
!=
0
))
{
// Double the pre-rotation Z, then halve the post-rotation Z. This reduces the
// vertical launch given from slopes while increasing the horizontal launch
...
...
@@ -710,8 +712,7 @@ fixed_t P_GetWallTransferMomZ(mobj_t *mo, pslope_t *slope)
void
P_HandleSlopeLanding
(
mobj_t
*
thing
,
pslope_t
*
slope
)
{
vector3_t
mom
;
// Ditto.
if
(
slope
->
flags
&
SL_NOPHYSICS
)
{
// No physics, no need to make anything complicated.
if
(
slope
->
flags
&
SL_NOPHYSICS
||
(
slope
->
normal
.
x
==
0
&&
slope
->
normal
.
y
==
0
))
{
// No physics, no need to make anything complicated.
if
(
P_MobjFlip
(
thing
)
*
(
thing
->
momz
)
<
0
)
// falling, land on slope
{
thing
->
standingslope
=
slope
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment