Difference between revisions of "Function for Time of Day"
Jump to navigation
Jump to search
Undo revision 29046 by Daemonjax (talk) testing my conclusion ingame seems impossible
imported>Daemonjax (casting Time to an int is faster than calling Math.Floor()) |
imported>Daemonjax |
||
Line 11: | Line 11: | ||
float Time = Utility.GetCurrentGameTime() | float Time = Utility.GetCurrentGameTime() | ||
Time -= (Time | Time -= Math.Floor(Time) ; Remove "previous in-game days passed" bit | ||
Time *= 24 ; Convert from fraction of a day to number of hours | Time *= 24 ; Convert from fraction of a day to number of hours | ||
Return Time | Return Time |