From 07ef0e9b3fad9977cd63a22ecabaff7deec8739f Mon Sep 17 00:00:00 2001 From: "Valeriano A.R" Date: Sat, 23 Aug 2014 18:12:23 +0200 Subject: [PATCH] =?UTF-8?q?Corregir=20fallo=20de=20iluminaci=C3=B3n=20fant?= =?UTF-8?q?asma?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- GameLib/Entity.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/GameLib/Entity.c b/GameLib/Entity.c index 4d7cd3b..e464c6c 100644 --- a/GameLib/Entity.c +++ b/GameLib/Entity.c @@ -854,25 +854,26 @@ void Entity_MarkUpdateLight(Entity e,Entity *elist,int n){ int i; vec2 max,min; - if(e->pos[0]oldpos[0]){ - min[0]=e->pos[0]-e->light[3]; + if(e->pos0[0]oldpos[0]){ + min[0]=e->pos0[0]-e->light[3]; max[0]=e->oldpos[0]+e->light[3]; }else{ min[0]=e->oldpos[0]-e->light[3]; - max[0]=e->pos[0]+e->light[3]; + max[0]=e->pos0[0]+e->light[3]; } - if(e->pos[1]oldpos[1]){ - min[1]=e->pos[1]-e->light[3]; + if(e->pos0[1]oldpos[1]){ + min[1]=e->pos0[1]-e->light[3]; max[1]=e->oldpos[1]+e->light[3]; }else{ min[1]=e->oldpos[1]-e->light[3]; - max[1]=e->pos[1]+e->light[3]; + max[1]=e->pos0[1]+e->light[3]; } for(i=0;ipos[0] && - max[0]>=elist[i]->pos[0] && - min[1]<=elist[i]->pos[1] && - max[1]>=elist[i]->pos[1]) + if( elist[i]!=NULL && + min[0]<=elist[i]->pos0[0] && + max[0]>=elist[i]->pos0[0] && + min[1]<=elist[i]->pos0[1] && + max[1]>=elist[i]->pos0[1]) { elist[i]->flags|=EntityFlag_UpdateLight; }