Fix executing a tick every second for a minute

This commit is contained in:
Marc Di Luzio 2020-06-06 16:31:39 +01:00
parent b9df3833ed
commit ea67fe1cbe

View file

@ -139,12 +139,12 @@ func (s *Server) Run() {
// Set up the schedule if requested
if s.tick != 0 {
if err := s.schedule.AddFunc(fmt.Sprintf("* */%d * * *", s.tick), func() {
if err := s.schedule.AddFunc(fmt.Sprintf("0 */%d * * *", s.tick), func() {
// Ensure we don't quit during this function
s.sync.Add(1)
defer s.sync.Done()
fmt.Println("Execuring server tick")
fmt.Println("Executing server tick")
// Run the command queues
s.world.ExecuteCommandQueues()