Always set entity size.

This commit is contained in:
Steve 2018-02-03 18:31:55 +00:00
parent 19f7afcf0e
commit 3d2000e818
2 changed files with 6 additions and 6 deletions

View File

@ -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)

View File

@ -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;