forked from Mirrors/openclonk
time isday and isnight return true and false if no time object is present
parent
171080cbd5
commit
2e297b6563
|
@ -79,7 +79,8 @@ public func IsDay()
|
||||||
var time_controller = FindObject(Find_ID(Time));
|
var time_controller = FindObject(Find_ID(Time));
|
||||||
if (time_controller)
|
if (time_controller)
|
||||||
return time_controller->IsDay();
|
return time_controller->IsDay();
|
||||||
return;
|
// If there is no time controller active it is day.
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
// Otherwise normal behavior.
|
// Otherwise normal behavior.
|
||||||
var day_start = (time_set.sunrise_start + time_set.sunrise_end) / 2;
|
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));
|
var time_controller = FindObject(Find_ID(Time));
|
||||||
if (time_controller)
|
if (time_controller)
|
||||||
return time_controller->IsNight();
|
return time_controller->IsNight();
|
||||||
return;
|
// If there is no time controller active it is not night.
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
// Otherwise normal behavior.
|
// Otherwise normal behavior.
|
||||||
var night_start = (time_set.sunset_start + time_set.sunset_end) / 2;
|
var night_start = (time_set.sunset_start + time_set.sunset_end) / 2;
|
||||||
|
|
Loading…
Reference in New Issue