A max tick time of -1 means unlimited

This commit is contained in:
Jamie Cameron
2015-04-05 12:05:32 -07:00
parent 6d553a10ad
commit d4264be5fd
2 changed files with 5 additions and 3 deletions

View File

@@ -110,7 +110,7 @@ print &ui_table_row($text{'conf_build'},
# Max time between ticks
my $ticks = &find_value("max-tick-time", $conf);
$ticks /= 1000.0 if ($ticks);
$ticks /= 1000.0 if ($ticks > 0);
print &ui_table_row($text{'conf_ticks'},
&ui_opt_textbox("ticks", $ticks, 5, $text{'default'}." (60s)").
" ".$text{'conf_ticksecs'}, 3);

View File

@@ -55,9 +55,11 @@ $in{'players'} =~ /^[1-9]\d*$/ || &error($text{'conf_eplayers'});
&save_directive("max-players", $in{'players'}, $conf);
# Max time between ticks
$in{'ticks_def'} || $in{'ticks'} =~ /^\d+(\.\d+)?$/ ||
$in{'ticks_def'} || $in{'ticks'} =~ /^\d+(\.\d+)?$/ || $in{'ticks'} == -1 ||
&error($text{'conf_eticks'});
&save_directive("max-tick-time", $in{'ticks_def'} ? undef : int($in{'ticks'}*1000), $conf);
&save_directive("max-tick-time", $in{'ticks_def'} ? undef :
$in{'ticks'} == -1 ? -1 :
int($in{'ticks'}*1000), $conf);
# Message of the day
$in{'motd_def'} || $in{'motd'} =~ /\S/ || &error($text{'conf_emotd'});