fixes
This commit is contained in:
@@ -39,7 +39,6 @@ export default function BattleShipBoard({
|
|||||||
const myIndex = players.findIndex((p) => p.user_id === myUserId);
|
const myIndex = players.findIndex((p) => p.user_id === myUserId);
|
||||||
const oppIndex = myIndex === 0 ? 1 : 0;
|
const oppIndex = myIndex === 0 ? 1 : 0;
|
||||||
|
|
||||||
console.log(metadata, "metadata");
|
|
||||||
const phase = metadata["phase"] ?? "lobby";
|
const phase = metadata["phase"] ?? "lobby";
|
||||||
const isMyTurn = phase === "battle" && turn === myIndex;
|
const isMyTurn = phase === "battle" && turn === myIndex;
|
||||||
|
|
||||||
@@ -68,8 +67,10 @@ export default function BattleShipBoard({
|
|||||||
function handleShoot(r: number, c: number) {
|
function handleShoot(r: number, c: number) {
|
||||||
sendMatchData(matchId!, 1, {
|
sendMatchData(matchId!, 1, {
|
||||||
action: "shoot",
|
action: "shoot",
|
||||||
row: r,
|
data: {
|
||||||
col: c,
|
row: r,
|
||||||
|
col: c,
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user