mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-04 15:31:21 +00:00
Can't have a radius of 0 here!
This commit is contained in:
parent
a8a92a57a7
commit
ea218c2e68
1 changed files with 14 additions and 12 deletions
26
src/p_map.c
26
src/p_map.c
|
@ -3964,23 +3964,25 @@ stairstep:
|
||||||
mo->momy = tmymove;
|
mo->momy = tmymove;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const fixed_t tmradius = mo->radius > 8 ? mo->radius : 8;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if (tmxmove > mo->radius) {
|
if (tmxmove > tmradius) {
|
||||||
newx = mo->x + mo->radius;
|
newx = mo->x + tmradius;
|
||||||
tmxmove -= mo->radius;
|
tmxmove -= tmradius;
|
||||||
} else if (tmxmove < -mo->radius) {
|
} else if (tmxmove < -tmradius) {
|
||||||
newx = mo->x - mo->radius;
|
newx = mo->x - tmradius;
|
||||||
tmxmove += mo->radius;
|
tmxmove += tmradius;
|
||||||
} else {
|
} else {
|
||||||
newx = mo->x + tmxmove;
|
newx = mo->x + tmxmove;
|
||||||
tmxmove = 0;
|
tmxmove = 0;
|
||||||
}
|
}
|
||||||
if (tmymove > mo->radius) {
|
if (tmymove > tmradius) {
|
||||||
newy = mo->y + mo->radius;
|
newy = mo->y + tmradius;
|
||||||
tmymove -= mo->radius;
|
tmymove -= tmradius;
|
||||||
} else if (tmymove < -mo->radius) {
|
} else if (tmymove < -tmradius) {
|
||||||
newy = mo->y - mo->radius;
|
newy = mo->y - tmradius;
|
||||||
tmymove += mo->radius;
|
tmymove += tmradius;
|
||||||
} else {
|
} else {
|
||||||
newy = mo->y + tmymove;
|
newy = mo->y + tmymove;
|
||||||
tmymove = 0;
|
tmymove = 0;
|
||||||
|
|
Loading…
Reference in a new issue