|
@@ -356,6 +356,7 @@ boolean bomb_explode(Game* g, int playerIndex, int x, int y, JsonEncoder* json)
|
|
|
JsonEncoder object, notif, coord;
|
|
|
JsonArray bomb, bonus, chain, explosion;
|
|
|
int res, index, cBomb = 0, cBonus = 0, cChain = 0;
|
|
|
+ obj_node* objn;
|
|
|
//Inie json
|
|
|
ini_encoder(&object);
|
|
|
ini_encoder(¬if);
|
|
@@ -373,16 +374,22 @@ boolean bomb_explode(Game* g, int playerIndex, int x, int y, JsonEncoder* json)
|
|
|
add_string(json, "type", "classic");
|
|
|
g->player[playerIndex]->classicBomb++;
|
|
|
g->player[playerIndex]->nbBomb--;
|
|
|
+ objn = object_search(g->player[playerIndex]->bomb, OBJ_BCLASSIC, x, y);
|
|
|
+ object_delete(g->player[playerIndex]->bomb, objn);
|
|
|
break;
|
|
|
case '2':
|
|
|
add_string(json, "type", "mine");
|
|
|
g->player[playerIndex]->mine++;
|
|
|
g->player[playerIndex]->nbBomb--;
|
|
|
+ objn = object_search(g->player[playerIndex]->bomb, OBJ_BMINE, x, y);
|
|
|
+ object_delete(g->player[playerIndex]->bomb, objn);
|
|
|
break;
|
|
|
case '3':
|
|
|
add_string(json, "type", "remote");
|
|
|
g->player[playerIndex]->remoteBomb++;
|
|
|
g->player[playerIndex]->nbBomb--;
|
|
|
+ objn = object_search(g->player[playerIndex]->bomb, OBJ_BREMOTE, x, y);
|
|
|
+ object_delete(g->player[playerIndex]->bomb, objn);
|
|
|
break;
|
|
|
default:
|
|
|
if (playerIndex >= 0) pthread_mutex_unlock(&playerMutex[(g->index * MAXPLAYER) + playerIndex]);
|