summaryrefslogtreecommitdiff
path: root/actions.c
diff options
context:
space:
mode:
authorOlivier Gayot <duskcoder@gmail.com>2015-01-07 15:34:29 +0100
committerOlivier Gayot <duskcoder@gmail.com>2015-01-07 15:34:29 +0100
commit461a28bb608e117267431eac78b08d3d8a089c0c (patch)
tree7fbd7306399db6223b1f0440d1fea6eb1c03b507 /actions.c
parent5b6986f617c554ac27b57373be0b874807e2d49d (diff)
do not pass a pointer to standard type when a copy is possible
Signed-off-by: Olivier Gayot <duskcoder@gmail.com>
Diffstat (limited to 'actions.c')
-rw-r--r--actions.c14
1 files changed, 8 insertions, 6 deletions
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;