diff --git a/src/pilot.c b/src/pilot.c index 8874eae..e025219 100644 --- a/src/pilot.c +++ b/src/pilot.c @@ -125,6 +125,9 @@ void pilot_render(Pilot* p) { // Get the sprite corresponding to the direction facing. sprite = (int)(p->solid->dir / (2.0*M_PI / (t->sy * t->sx))); + + // Ugly hack to make sure it's always "inbound". + if(sprite > (int)(t->sy*t->sx)-1) sprite = (int)(t->sy*t->sx)-1; gl_blitSprite(t, &p->solid->pos, sprite % (int)t->sx, sprite / (int)t->sy); }