From 461a28bb608e117267431eac78b08d3d8a089c0c Mon Sep 17 00:00:00 2001 From: Olivier Gayot Date: Wed, 7 Jan 2015 15:34:29 +0100 Subject: do not pass a pointer to standard type when a copy is possible Signed-off-by: Olivier Gayot --- actions.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'actions.c') diff --git a/actions.c b/actions.c index 1877664..8460341 100644 --- a/actions.c +++ b/actions.c @@ -46,7 +46,7 @@ void Fattaquer(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int case SDLK_RETURN: case SDLK_f: continuer=0; - max=Fcalculerdegats(persos,Vtourallie,&min,ennemis,selection,clan,TYPE_ATTAQUE); + max=Fcalculerdegats(persos, *Vtourallie,&min,ennemis,selection,clan,TYPE_ATTAQUE); degats=(rand()%(max-min+1))+min; if(degats<0) degats=0; @@ -118,9 +118,11 @@ void Fattaquer(SURFACES *surfaces,POSITIONS *positions,PERSONNAGES persos[],int SDL_Delay(1000); SDL_BlitSurface(surfaces->Pfondjeu,&positions->Vpositiondegats,surfaces->Pecran,&positions->Vpositiondegats); SDL_Flip(surfaces->Pecran); + + return ret; } -int Fcalculerdegats(PERSONNAGES persos[],int *Vtourallie,int *min,ENNEMIS ennemis[],int selection,int camp,int type) +int Fcalculerdegats(PERSONNAGES persos[], int Vtourallie,int *min,ENNEMIS ennemis[],int selection,int camp,int type) { unsigned int degats; int max; @@ -129,16 +131,16 @@ int Fcalculerdegats(PERSONNAGES persos[],int *Vtourallie,int *min,ENNEMIS ennemi if(type==TYPE_ATTAQUE) { if(camp==ENNEMI) - degats=persos[*Vtourallie].force*60-ennemis[selection].defense*50; + degats=persos[Vtourallie].force*60-ennemis[selection].defense*50; else - degats=persos[*Vtourallie].force*60-persos[selection].defense*50; + degats=persos[Vtourallie].force*60-persos[selection].defense*50; } else { if(camp==ENNEMI) - degats=persos[*Vtourallie].magie*60-ennemis[selection].defensemagique*50; + degats=persos[Vtourallie].magie*60-ennemis[selection].defensemagique*50; else - degats=persos[*Vtourallie].magie*60-persos[selection].defensemagique*50; + degats=persos[Vtourallie].magie*60-persos[selection].defensemagique*50; } taux=degats/4; max=degats+taux; -- cgit v1.2.3