|
@@ -356,7 +356,6 @@ boolean bomb_explode(Game* g, int playerIndex, int x, int y, JsonEncoder* json)
|
|
|
JsonEncoder object, notif;
|
|
|
JsonArray bomb, bonus, chain;
|
|
|
int res, index, cBomb = 0, cBonus = 0, cChain = 0;
|
|
|
- char* map;
|
|
|
//Inie json
|
|
|
ini_encoder(&object);
|
|
|
ini_encoder(¬if);
|
|
@@ -613,8 +612,9 @@ boolean bomb_explode(Game* g, int playerIndex, int x, int y, JsonEncoder* json)
|
|
|
}
|
|
|
}
|
|
|
//Affichage de la map
|
|
|
- map = unparse_map(g->map, g->width, g->height);
|
|
|
- add_string(json, "map", map);
|
|
|
+ free(g->mapContent);
|
|
|
+ g->mapContent = unparse_map(g->map, g->width, g->height);
|
|
|
+ add_string(json, "map", g->mapContent);
|
|
|
//Ajout des json
|
|
|
add_array(json, "bomb", &bomb);
|
|
|
add_array(json, "bonusMalus", &bonus);
|
|
@@ -622,7 +622,6 @@ boolean bomb_explode(Game* g, int playerIndex, int x, int y, JsonEncoder* json)
|
|
|
//Nettoyage
|
|
|
if(playerIndex >= 0) pthread_mutex_unlock(&playerMutex[(g->index * MAXPLAYER) + playerIndex]);
|
|
|
pthread_mutex_unlock(&gameMutex[g->index]);
|
|
|
- free(map);
|
|
|
return true;
|
|
|
}
|
|
|
|