This commit is contained in:
cay 2026-03-30 15:15:41 +01:00
parent ecb1e7b64f
commit 477820146b

6
app.js
View File

@ -224,10 +224,10 @@ app.post("/api/building/:id/upgrade", requireLogin, async (req, res) => {
[levelData.wood, levelData.stone, levelData.gold, userId],
);
// Level erhöhen, Punkte zurücksetzen
// Level erhöhen, nur benötigte Punkte abziehen
await db.query(
"UPDATE user_buildings SET level = ?, points = 0 WHERE id = ?",
[nextLevel, userBuilding.id],
"UPDATE user_buildings SET level = ?, points = points - ? WHERE id = ?",
[nextLevel, levelData.required_points, userBuilding.id],
);
res.json({