From 3cb6888b5b6359ba34b2295faeff7f167b04d2a9 Mon Sep 17 00:00:00 2001 From: Rob Pearce Date: Sun, 21 Dec 2008 00:16:37 +0000 Subject: [PATCH] Removed bug --- defs.h | 4 ---- rc.c | 15 --------------- shared.c | 4 ---- 3 files changed, 23 deletions(-) diff --git a/defs.h b/defs.h index 09b3ca0..bdaa4ff 100644 --- a/defs.h +++ b/defs.h @@ -965,10 +965,6 @@ typedef struct sprite_s { // both player and monster struct sprite_s *onplatform;// are we on platform? - // for optimisation - double lastx,lasty; - int lastonground; - int antigrav; // don't fall int lives; // only for player and bosses int swimming; // are we in the water? diff --git a/rc.c b/rc.c index 8d4fe17..0d1b8fe 100644 --- a/rc.c +++ b/rc.c @@ -6486,39 +6486,27 @@ int isroofnabove(sprite_t *s, int howfar) { 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? if (s->onplatform) { - s->lastonground = B_TRUE; return B_TRUE; } // antigrav? if (s->antigrav ) { - s->lastonground = B_TRUE; return B_TRUE; } /* get tile below sprite's feet */ if (isongroundpoint(s, s->x, s->y)) { - s->lastonground = B_TRUE; return B_TRUE; } if ((s->dead) || (!s->falling && !s->dropping)) { if (!s->swimming) { if (isongroundpoint(s, s->x + s->img->w/2, s->y)) { - s->lastonground = B_TRUE; return B_TRUE; } if (isongroundpoint(s, s->x - s->img->w/2, s->y)) { - s->lastonground = B_TRUE; return B_TRUE; } } @@ -6527,16 +6515,13 @@ int isonground(sprite_t *s) { //if (s->falling && s->id == P_KINGRAT) { if (s->id == P_KINGRAT) { if (isongroundpoint(s, s->x + s->img->w/2, s->y)) { - s->lastonground = B_TRUE; return B_TRUE; } if (isongroundpoint(s, s->x - s->img->w/2, s->y)) { - s->lastonground = B_TRUE; return B_TRUE; } } - s->lastonground = B_FALSE; return B_FALSE; } diff --git a/shared.c b/shared.c index 6ea3e0f..ef5e879 100644 --- a/shared.c +++ b/shared.c @@ -715,10 +715,6 @@ void setdefaults(sprite_t *s) { s->netmax = 1; } - s->lastx = -99; - s->lasty = -99; - s->lastonground = B_FALSE; - s->doublejumpready = B_FALSE;