fix: created ships exact tech level

This commit is contained in:
Ilia Denisov
2026-02-17 19:06:26 +02:00
parent 16e281cfd6
commit 1379241967
6 changed files with 38 additions and 19 deletions
+2 -1
View File
@@ -8,6 +8,7 @@ import (
"github.com/google/uuid"
e "github.com/iliadenisov/galaxy/internal/error"
"github.com/iliadenisov/galaxy/internal/model/game"
"github.com/iliadenisov/galaxy/internal/number"
"github.com/iliadenisov/galaxy/internal/util"
)
@@ -183,7 +184,7 @@ func (c *Cache) TurnPlanetProductions() {
cost := sg.StateUpgrade.Cost()
if productionAvailable >= cost {
for i := range sg.StateUpgrade.UpgradeTech {
sg.Tech = sg.Tech.Set(sg.StateUpgrade.UpgradeTech[i].Tech, sg.StateUpgrade.UpgradeTech[i].Level.F())
sg.Tech = sg.Tech.Set(sg.StateUpgrade.UpgradeTech[i].Tech, number.Fixed3(sg.StateUpgrade.UpgradeTech[i].Level.F()))
}
productionAvailable -= cost
}