diff --git a/frontend/pages/riichi/chap5.html b/frontend/pages/riichi/chap5.html
index a7cc405..f8242a7 100644
--- a/frontend/pages/riichi/chap5.html
+++ b/frontend/pages/riichi/chap5.html
@@ -157,31 +157,20 @@
console.log('Réponse API', data);
if (data.state && data.state.hand_player) {
displayHand(data.state.hand_player, 'hand-0');
- // joueur 1
- fetch('/api/game/hand/1')
- .then(r => r.json())
- .then(botData => {
- if (botData.hand) {
- displayHand(botData.hand, 'hand-1');
- }
- });
- // joueur 2
- fetch('/api/game/hand/2')
- .then(r => r.json())
- .then(botData => {
- if (botData.hand) {
- displayHand(botData.hand, 'hand-2');
- }
- });
- // joueur 3
- fetch('/api/game/hand/3')
- .then(r => r.json())
- .then(botData => {
- if (botData.hand) {
- displayHand(botData.hand, 'hand-3');
- }
- });
}
+ // Affichage des mains bots (1, 2, 3)
+ [1, 2, 3].forEach(id => {
+ fetch(`/api/game/hand/${id}`)
+ .then(r => r.json())
+ .then(botData => {
+ if (botData.hand) {
+ displayHand(botData.hand, `hand-${id}`);
+ } else {
+ console.error(`Main vide pour joueur ${id}`);
+ }
+ })
+ .catch(e => console.error(`Erreur main ${id}`, e));
+ });
})
.catch(e => console.error('Erreur initialisation partie', e));
@@ -190,7 +179,12 @@
display.innerHTML = '';
hand.forEach(tile => {
const tileDiv = document.createElement('div');
- tileDiv.innerHTML = tile.svg;
+ // Affiche le dos des tuiles pour les bots
+ if (displayId !== 'hand-0') {
+ tileDiv.innerHTML = '';
+ } else {
+ tileDiv.innerHTML = tile.svg;
+ }
display.appendChild(tileDiv);
});
}