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
Richard Gobeille
EDuke32
Commits
e43d59d1
Commit
e43d59d1
authored
Apr 04, 2022
by
Dino Bollinger
Committed by
Richard Gobeille
Apr 11, 2022
Browse files
Engine: Prevent infinite loop in clipmove() for ENGINE_EDUKE32 compatibility
parent
c819ba04
Changes
1
Hide whitespace changes
Inline
Side-by-side
source/build/src/clip.cpp
View file @
e43d59d1
...
...
@@ -1568,6 +1568,9 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
native_t
cnt
=
clipmoveboxtracenum
;
// In ENGINE_EDUKE32 mode, the loop below may become endless in edge cases. This variable ensures that it will break out eventually.
native_t
failsafe_cnt
=
cnt
;
do
{
if
(
enginecompatibilitymode
==
ENGINE_EDUKE32
&&
(
xvect
|
yvect
))
...
...
@@ -1643,12 +1646,15 @@ int32_t clipmove(vec3_t * const pos, int16_t * const sectnum, int32_t xvect, int
if
(
enginecompatibilitymode
==
ENGINE_EDUKE32
)
if
(
clipupdatesector
(
vec
,
sectnum
,
rad
))
{
failsafe_cnt
--
;
continue
;
}
pos
->
x
=
vec
.
x
;
pos
->
y
=
vec
.
y
;
cnt
--
;
}
while
((
xvect
|
yvect
)
!=
0
&&
hitwall
>=
0
&&
cnt
>
0
);
}
while
((
xvect
|
yvect
)
!=
0
&&
hitwall
>=
0
&&
cnt
>
0
&&
failsafe_cnt
>
0
);
if
(
enginecompatibilitymode
!=
ENGINE_EDUKE32
)
clipmove_compat
(
pos
,
sectnum
);
...
...
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