fix: empty skills usage causes fights to freeze
authorxangelo <git@xangelo.ca>
Wed, 14 Jun 2023 08:08:47 +0000 (04:08 -0400)
committerxangelo <git@xangelo.ca>
Wed, 14 Jun 2023 08:08:47 +0000 (04:08 -0400)
src/server/skills.ts

index 59d507508cdcab4c4990f15a3eff74883af52a7f..131c1415bd2f553a774e92117b121f77a65d99c4 100644 (file)
@@ -27,5 +27,8 @@ export async function updatePlayerSkills(playerId: string, skills: Record<SkillI
     sql.push(`update player_skills set exp = exp + ${val} where id = '${skillId}' and player_id = '${playerId}'`);
   });
 
-  await db.raw(sql.join(';'));
+  if(sql.length) {
+    await db.raw(sql.join(';'));
+  }
+
 }