Player no longer slides on ice while underwater
This commit is contained in:
parent
3192ca6ade
commit
30ec68f70d
10
rc.c
10
rc.c
|
@ -1526,7 +1526,7 @@ void jump(sprite_t *s, int dir) {
|
||||||
s->jumpdir++;
|
s->jumpdir++;
|
||||||
} else if ((tt->id == T_LEFT) && (s->jumpdir < 0)) {
|
} else if ((tt->id == T_LEFT) && (s->jumpdir < 0)) {
|
||||||
s->jumpdir--;
|
s->jumpdir--;
|
||||||
} else if (isice(tt->id)) {
|
} else if (isice(tt->id) && !isinwater(s)) {
|
||||||
s->jumpdir = s->xs / getspeed(s);
|
s->jumpdir = s->xs / getspeed(s);
|
||||||
//if (s->jumpdir > getspeed(s)) s->jumpdir -= getspeed(s);
|
//if (s->jumpdir > getspeed(s)) s->jumpdir -= getspeed(s);
|
||||||
//if (s->jumpdir < -getspeed(s)) s->jumpdir += getspeed(s);
|
//if (s->jumpdir < -getspeed(s)) s->jumpdir += getspeed(s);
|
||||||
|
@ -5493,7 +5493,7 @@ void dotileeffects(sprite_t *s) {
|
||||||
}
|
}
|
||||||
finished = B_TRUE;
|
finished = B_TRUE;
|
||||||
} else if (isice(tt->id)) {
|
} else if (isice(tt->id)) {
|
||||||
if (isplayer(s)) {
|
if (isplayer(s) && !isinwater(s)) {
|
||||||
if (globpowerup != PW_CLOCK) {
|
if (globpowerup != PW_CLOCK) {
|
||||||
if (!s->moved) {
|
if (!s->moved) {
|
||||||
if (s->xs != 0) {
|
if (s->xs != 0) {
|
||||||
|
@ -7913,7 +7913,7 @@ int movex(sprite_t *s,double amt,int onpurpose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get new position */
|
/* get new position */
|
||||||
if (isplayer(s) && isice(tt->id) && onpurpose) {
|
if (isplayer(s) && isice(tt->id) && !isinwater(s) && onpurpose ) {
|
||||||
double newxs;
|
double newxs;
|
||||||
// change speed
|
// change speed
|
||||||
newxs = s->xs + (s->dir*ICEACCEL);
|
newxs = s->xs + (s->dir*ICEACCEL);
|
||||||
|
@ -7949,7 +7949,7 @@ int movex(sprite_t *s,double amt,int onpurpose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (domove) {
|
if (domove) {
|
||||||
if (isplayer(s) && isice(tt->id) && onpurpose) {
|
if (isplayer(s) && isice(tt->id) && !isinwater(s) && onpurpose) {
|
||||||
// change speed
|
// change speed
|
||||||
s->xs += (s->dir*ICEACCEL);
|
s->xs += (s->dir*ICEACCEL);
|
||||||
// don't get too fast!
|
// don't get too fast!
|
||||||
|
@ -7962,7 +7962,7 @@ int movex(sprite_t *s,double amt,int onpurpose) {
|
||||||
s->x += amt;
|
s->x += amt;
|
||||||
s->xs = amt;
|
s->xs = amt;
|
||||||
if (!onpurpose) {
|
if (!onpurpose) {
|
||||||
if (isice(tt->id)) {
|
if (isice(tt->id) && !isinwater(s)) {
|
||||||
s->moved = MV_ICE;
|
s->moved = MV_ICE;
|
||||||
} else {
|
} else {
|
||||||
s->moved = MV_WALK;
|
s->moved = MV_WALK;
|
||||||
|
|
Loading…
Reference in New Issue