Removed bug
This commit is contained in:
parent
70794f79eb
commit
3cb6888b5b
4
defs.h
4
defs.h
|
@ -965,10 +965,6 @@ typedef struct sprite_s {
|
||||||
// both player and monster
|
// both player and monster
|
||||||
struct sprite_s *onplatform;// are we on platform?
|
struct sprite_s *onplatform;// are we on platform?
|
||||||
|
|
||||||
// for optimisation
|
|
||||||
double lastx,lasty;
|
|
||||||
int lastonground;
|
|
||||||
|
|
||||||
int antigrav; // don't fall
|
int antigrav; // don't fall
|
||||||
int lives; // only for player and bosses
|
int lives; // only for player and bosses
|
||||||
int swimming; // are we in the water?
|
int swimming; // are we in the water?
|
||||||
|
|
15
rc.c
15
rc.c
|
@ -6486,39 +6486,27 @@ int isroofnabove(sprite_t *s, int howfar) {
|
||||||
|
|
||||||
int isonground(sprite_t *s) {
|
int isonground(sprite_t *s) {
|
||||||
|
|
||||||
// attempt to optimise...
|
|
||||||
if ((s->x == s->lastx) && (s->y == s->lasty)) {
|
|
||||||
return s->lastonground;
|
|
||||||
} else {
|
|
||||||
s->lastx = s->x;
|
|
||||||
s->lasty = s->y;
|
|
||||||
}
|
|
||||||
|
|
||||||
// are we on a platform?
|
// are we on a platform?
|
||||||
if (s->onplatform) {
|
if (s->onplatform) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
// antigrav?
|
// antigrav?
|
||||||
if (s->antigrav ) {
|
if (s->antigrav ) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get tile below sprite's feet */
|
/* get tile below sprite's feet */
|
||||||
if (isongroundpoint(s, s->x, s->y)) {
|
if (isongroundpoint(s, s->x, s->y)) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if ((s->dead) || (!s->falling && !s->dropping)) {
|
if ((s->dead) || (!s->falling && !s->dropping)) {
|
||||||
if (!s->swimming) {
|
if (!s->swimming) {
|
||||||
if (isongroundpoint(s, s->x + s->img->w/2, s->y)) {
|
if (isongroundpoint(s, s->x + s->img->w/2, s->y)) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if (isongroundpoint(s, s->x - s->img->w/2, s->y)) {
|
if (isongroundpoint(s, s->x - s->img->w/2, s->y)) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6527,16 +6515,13 @@ int isonground(sprite_t *s) {
|
||||||
//if (s->falling && s->id == P_KINGRAT) {
|
//if (s->falling && s->id == P_KINGRAT) {
|
||||||
if (s->id == P_KINGRAT) {
|
if (s->id == P_KINGRAT) {
|
||||||
if (isongroundpoint(s, s->x + s->img->w/2, s->y)) {
|
if (isongroundpoint(s, s->x + s->img->w/2, s->y)) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
if (isongroundpoint(s, s->x - s->img->w/2, s->y)) {
|
if (isongroundpoint(s, s->x - s->img->w/2, s->y)) {
|
||||||
s->lastonground = B_TRUE;
|
|
||||||
return B_TRUE;
|
return B_TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
s->lastonground = B_FALSE;
|
|
||||||
return B_FALSE;
|
return B_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue