dh
This commit is contained in:
parent
ecb1e7b64f
commit
477820146b
6
app.js
6
app.js
@ -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({
|
||||
|
||||
Loading…
Reference in New Issue
Block a user