Spaces:
Sleeping
Sleeping
final try
Browse files
src/components/Game.tsx
CHANGED
|
@@ -100,7 +100,7 @@ export default function Game() {
|
|
| 100 |
console.log("game.playerDescriptions",game.playerDescriptions)
|
| 101 |
console.log("game.world.players",game.world.players)
|
| 102 |
const playerId = [...game.world.players.values()].find(
|
| 103 |
-
(p) => p.human === humanTokenIdentifier,
|
| 104 |
)?.id;
|
| 105 |
console.log("playerId",playerId)
|
| 106 |
|
|
|
|
| 100 |
console.log("game.playerDescriptions",game.playerDescriptions)
|
| 101 |
console.log("game.world.players",game.world.players)
|
| 102 |
const playerId = [...game.world.players.values()].find(
|
| 103 |
+
(p) => !!p && p.human === humanTokenIdentifier,
|
| 104 |
)?.id;
|
| 105 |
console.log("playerId",playerId)
|
| 106 |
|
src/components/PixiGame.tsx
CHANGED
|
@@ -32,7 +32,7 @@ export const PixiGame = (props: {
|
|
| 32 |
const humanTokenIdentifier = useQuery(api.world.userStatus, { worldId: props.worldId, oauthToken }) ?? null;
|
| 33 |
|
| 34 |
const humanPlayerId = [...props.game.world.players.values()].find(
|
| 35 |
-
(p) =>
|
| 36 |
)?.id;
|
| 37 |
|
| 38 |
const moveTo = useSendInput(props.engineId, 'moveTo');
|
|
|
|
| 32 |
const humanTokenIdentifier = useQuery(api.world.userStatus, { worldId: props.worldId, oauthToken }) ?? null;
|
| 33 |
|
| 34 |
const humanPlayerId = [...props.game.world.players.values()].find(
|
| 35 |
+
(p) => !! p && p.human === humanTokenIdentifier,
|
| 36 |
)?.id;
|
| 37 |
|
| 38 |
const moveTo = useSendInput(props.engineId, 'moveTo');
|
src/components/PlayerDetails.tsx
CHANGED
|
@@ -37,7 +37,7 @@ export default function PlayerDetails({
|
|
| 37 |
// Always select the other player if we're in a conversation with them.
|
| 38 |
if (humanPlayer && humanConversation) {
|
| 39 |
const otherPlayerIds = [...humanConversation.participants.keys()].filter(
|
| 40 |
-
(p) => p !== humanPlayer.id,
|
| 41 |
);
|
| 42 |
playerId = otherPlayerIds[0];
|
| 43 |
}
|
|
|
|
| 37 |
// Always select the other player if we're in a conversation with them.
|
| 38 |
if (humanPlayer && humanConversation) {
|
| 39 |
const otherPlayerIds = [...humanConversation.participants.keys()].filter(
|
| 40 |
+
(p) => !!p && p !== humanPlayer.id,
|
| 41 |
);
|
| 42 |
playerId = otherPlayerIds[0];
|
| 43 |
}
|