Bläddra i källkod

Récupération bombe

Arthur Brandao 6 år sedan
förälder
incheckning
3cfb466dae
2 ändrade filer med 4 tillägg och 1 borttagningar
  1. 3 0
      Serveur/game.c
  2. 1 1
      Serveur/player.c

+ 3 - 0
Serveur/game.c

@@ -349,12 +349,15 @@ boolean bomb_explode(Game* g, int playerIndex, int x, int y, JsonEncoder* json)
     switch (g->map[x][y]) {
         case '1':
             add_string(json, "type", "classic");
+            g->player[playerIndex]->classicBomb++;
             break;
         case '2':
             add_string(json, "type", "mine");
+            g->player[playerIndex]->mine++;
             break;
         case '3':
             add_string(json, "type", "remote");
+            g->player[playerIndex]->remoteBomb++;
             break;
         default:
             if(playerIndex >= 0) pthread_mutex_unlock(&playerMutex[(g->index * MAXPLAYER) + playerIndex]);

+ 1 - 1
Serveur/player.c

@@ -24,7 +24,7 @@ void create_player(Player* p, Client* c){
     p->speed = 1;
     p->classicBomb = 1;
     p->mine = 0;
-    p->remoteBomb = 0;
+    p->remoteBomb = 1;
     p->maxBomb = 2;
     p->nbBomb = 0;
     p->bombUp = 0;