Spaces:
Sleeping
Sleeping
descriptions
Browse files- patches/convex/world.ts +2 -1
patches/convex/world.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
import { ConvexError, v } from 'convex/values';
|
2 |
import { internalMutation, mutation, query } from './_generated/server';
|
3 |
import { characters } from '../data/characters';
|
|
|
4 |
import { insertInput } from './aiTown/insertInput';
|
5 |
import {
|
6 |
DEFAULT_NAME,
|
@@ -138,7 +139,7 @@ export const joinWorld = mutation({
|
|
138 |
throw new ConvexError(`Invalid world ID: ${args.worldId}`);
|
139 |
}
|
140 |
// Select a random character description
|
141 |
-
const randomCharacter =
|
142 |
|
143 |
return await insertInput(ctx, world._id, 'join', {
|
144 |
name: randomCharacter.name,
|
|
|
1 |
import { ConvexError, v } from 'convex/values';
|
2 |
import { internalMutation, mutation, query } from './_generated/server';
|
3 |
import { characters } from '../data/characters';
|
4 |
+
import { Descriptions } from '../data/characters';
|
5 |
import { insertInput } from './aiTown/insertInput';
|
6 |
import {
|
7 |
DEFAULT_NAME,
|
|
|
139 |
throw new ConvexError(`Invalid world ID: ${args.worldId}`);
|
140 |
}
|
141 |
// Select a random character description
|
142 |
+
const randomCharacter = Descriptions[Math.floor(Math.random() * Descriptions.length)];
|
143 |
|
144 |
return await insertInput(ctx, world._id, 'join', {
|
145 |
name: randomCharacter.name,
|