diff --git a/cardinal/constants/constants.go b/cardinal/constants/constants.go index 262a2cb..e23be95 100644 --- a/cardinal/constants/constants.go +++ b/cardinal/constants/constants.go @@ -3,4 +3,3 @@ package constants import "time" const TickRate = time.Second -const MillisecondsInSecond = 1000 diff --git a/cardinal/system/effects_spawner.go b/cardinal/system/effects_spawner.go index 0e0da46..b609c2a 100644 --- a/cardinal/system/effects_spawner.go +++ b/cardinal/system/effects_spawner.go @@ -1,6 +1,8 @@ package system import ( + "time" + "pkg.world.dev/world-engine/cardinal" "pkg.world.dev/world-engine/cardinal/search/filter" "pkg.world.dev/world-engine/cardinal/types" @@ -39,7 +41,7 @@ func EffectsSpawnerSystem(world cardinal.WorldContext) error { previousEffectAmount := effectComponent.Amount endBuildingTime := effectComponent.BuildingTimeStartedAt + - uint64(effectComponent.BuildingTimeSeconds*constants.MillisecondsInSecond) + uint64(time.Duration(effectComponent.BuildingTimeSeconds)*time.Second/time.Millisecond) if world.Timestamp() < endBuildingTime { return true