Skip to content
Prev Previous commit
Next Next commit
OnStart Trigger Fix
  • Loading branch information
N1Ran committed Mar 31, 2019
commit f1821d7f287641b9c48500b42b3e8e6bafc320cf
6 changes: 4 additions & 2 deletions Essentials/AutoCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,11 @@ private bool CanRun(AutoCommand command)
case Trigger.Disabled:
return false;
case Trigger.OnStart:
var a = TimeSpan.Parse(command.Interval);
var a = Math.Max(TimeSpan.Parse(command.Interval).TotalSeconds, 60);
var b = ((ITorchServer)TorchBase.Instance).ElapsedPlayTime;
return ((a - b).TotalSeconds <= 1 && (a - b).TotalSeconds > 0);
if ((a - b.TotalSeconds) <= 1 && (a - b.TotalSeconds > 0))
command.RunNow();
break;
case Trigger.Vote:
break;
case Trigger.Timed:
Expand Down