Skip to content

Commit

Permalink
fix(top_scoreboard): daytime is incorrect
Browse files Browse the repository at this point in the history
Refs #398.
  • Loading branch information
ark120202 committed Nov 21, 2018
1 parent c70157c commit aba081d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions content/panorama/scripts/top_scoreboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,14 @@ function Update() {
var rawTime = Game.GetDOTATime(false, true);
var time = Math.abs(rawTime);
var isNSNight = rawTime < darknessEndTime;
var timeThisDayLasts = time - (Math.floor(time / 480) * 480);
var isDayTime = !isNSNight && timeThisDayLasts <= 240;
var timeThisDayLasts = time - (Math.floor(time / 600) * 600);
var isDayTime = !isNSNight && timeThisDayLasts <= 300;
var context = $.GetContextPanel();

context.SetHasClass('DayTime', isDayTime);
context.SetHasClass('NightTime', !isDayTime);
context.SetDialogVariable('time_of_day', secondsToMS(time, true));
context.SetDialogVariable('time_until', secondsToMS((isDayTime ? 240 : 480) - timeThisDayLasts, true));
context.SetDialogVariable('time_until', secondsToMS((isDayTime ? 300 : 600) - timeThisDayLasts, true));
context.SetDialogVariable('day_phase', $.Localize(isDayTime ? 'DOTA_HUD_Night' : 'DOTA_HUD_Day'));

$('#DayTime').visible = isDayTime;
Expand Down

0 comments on commit aba081d

Please sign in to comment.