From 3d2000e818f1ca61e0564af1f511622fed6045cf Mon Sep 17 00:00:00 2001 From: Steve Date: Sat, 3 Feb 2018 18:31:55 +0000 Subject: [PATCH] Always set entity size. --- src/entities/entity.c | 6 ------ src/world/entities.c | 6 ++++++ 2 files changed, 6 insertions(+), 6 deletions(-) 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;