diff --git a/src/entities/entity.c b/src/entities/entity.c index 5cbe7ce..fd9cf0a 100644 --- a/src/entities/entity.c +++ b/src/entities/entity.c @@ -91,7 +91,6 @@ static void action(void) static void animate(void) { Sprite *s; - SDL_Rect *r; s = self->sprite[self->facing]; @@ -107,11 +106,6 @@ static void animate(void) self->spriteTime = self->sprite[self->facing]->times[self->spriteFrame]; } } - - r = &self->sprite[self->facing]->frames[self->spriteFrame]->rect; - - self->w = r->w; - self->h = r->h; } static float bounce(float x) diff --git a/src/world/entities.c b/src/world/entities.c index 0f534ad..4a34ee3 100644 --- a/src/world/entities.c +++ b/src/world/entities.c @@ -59,6 +59,7 @@ void doEntities(void) { Entity *prev, *oldSelf; int camMidX, camMidY, flicker, i; + SDL_Rect *r; memset(riders, 0, sizeof(Entity*) * MAX_RIDERS); @@ -75,6 +76,11 @@ void doEntities(void) for (self = world.entityHead.next ; self != NULL ; self = self->next) { + r = &self->sprite[self->facing]->frames[self->spriteFrame]->rect; + + self->w = r->w; + self->h = r->h; + removeFromQuadtree(self, &world.quadtree); self->isOnScreen = 0;