time isday and isnight return true and false if no time object is present

shapetextures
Maikel de Vries 2015-12-12 18:15:40 +01:00
parent 171080cbd5
commit 2e297b6563
1 changed files with 4 additions and 2 deletions

View File

@ -79,7 +79,8 @@ public func IsDay()
var time_controller = FindObject(Find_ID(Time));
if (time_controller)
return time_controller->IsDay();
return;
// If there is no time controller active it is day.
return true;
}
// Otherwise normal behavior.
var day_start = (time_set.sunrise_start + time_set.sunrise_end) / 2;
@ -97,7 +98,8 @@ public func IsNight()
var time_controller = FindObject(Find_ID(Time));
if (time_controller)
return time_controller->IsNight();
return;
// If there is no time controller active it is not night.
return false;
}
// Otherwise normal behavior.
var night_start = (time_set.sunset_start + time_set.sunset_end) / 2;