Skip to content

Commit

Permalink
Reverted time durations counting procedure
Browse files Browse the repository at this point in the history
  • Loading branch information
k-karuna committed Jul 8, 2024
1 parent 504f68c commit 2d50ef8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 0 additions & 1 deletion cardinal/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,3 @@ package constants
import "time"

const TickRate = time.Second
const MillisecondsInSecond = 1000
4 changes: 3 additions & 1 deletion cardinal/system/effects_spawner.go
Original file line number Diff line number Diff line change
@@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2d50ef8

Please sign in to comment.