mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-24 13:21:20 +00:00
Merge branch 'issue947' into 'next'
Issue #947 - Can't have a radius of 0 here! Closes #947 See merge request STJr/SRB2!2362
This commit is contained in:
commit
9374344f09
1 changed files with 14 additions and 12 deletions
26
src/p_map.c
26
src/p_map.c
|
@ -3961,23 +3961,25 @@ papercollision:
|
|||
mo->momy = tmymove;
|
||||
}
|
||||
|
||||
const fixed_t tmradius = mo->radius > 8 ? mo->radius : 8;
|
||||
|
||||
do {
|
||||
if (tmxmove > mo->radius) {
|
||||
newx = mo->x + mo->radius;
|
||||
tmxmove -= mo->radius;
|
||||
} else if (tmxmove < -mo->radius) {
|
||||
newx = mo->x - mo->radius;
|
||||
tmxmove += mo->radius;
|
||||
if (tmxmove > tmradius) {
|
||||
newx = mo->x + tmradius;
|
||||
tmxmove -= tmradius;
|
||||
} else if (tmxmove < -tmradius) {
|
||||
newx = mo->x - tmradius;
|
||||
tmxmove += tmradius;
|
||||
} else {
|
||||
newx = mo->x + tmxmove;
|
||||
tmxmove = 0;
|
||||
}
|
||||
if (tmymove > mo->radius) {
|
||||
newy = mo->y + mo->radius;
|
||||
tmymove -= mo->radius;
|
||||
} else if (tmymove < -mo->radius) {
|
||||
newy = mo->y - mo->radius;
|
||||
tmymove += mo->radius;
|
||||
if (tmymove > tmradius) {
|
||||
newy = mo->y + tmradius;
|
||||
tmymove -= tmradius;
|
||||
} else if (tmymove < -tmradius) {
|
||||
newy = mo->y - tmradius;
|
||||
tmymove += tmradius;
|
||||
} else {
|
||||
newy = mo->y + tmymove;
|
||||
tmymove = 0;
|
||||
|
|
Loading…
Reference in a new issue