fix: new players don't get their profession set
authorxangelo <git@xangelo.ca>
Wed, 14 Jun 2023 08:32:13 +0000 (04:32 -0400)
committerxangelo <git@xangelo.ca>
Wed, 14 Jun 2023 08:32:13 +0000 (04:32 -0400)
src/server/player.ts

index 73e0a1309aa65b3e90be81797d00bfd45eee792e..8a3aa7d7b47edf38ca4db6c275c10b21b8f9d144 100644 (file)
@@ -47,6 +47,14 @@ export async function createPlayer(): Promise<Player> {
 
   await db.raw(sql + pairs.join(','), values);
 
+  // create the profession level
+  db('profession_levels').insert({
+    player_id: player.id,
+    profession: 'Wanderer',
+    level: 1,
+    exp: 0
+  });
+
   return player;
 }