diff options
Diffstat (limited to 'Northstar.CustomServers/mod/scripts')
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut | 23 |
1 files changed, 8 insertions, 15 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut index 3546e3b7..4e5c5aa9 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut @@ -4017,7 +4017,7 @@ int function GameTime_TimeLeftMinutes() if ( GetGameState() == eGameState.Prematch ) return int( ( expect float( GetServerVar( "gameStartTime" ) ) - Time()) / 60.0 ) - return floor( GameTime_TimeLimitMinutes() - GameTime_PlayingTime() / 60 ).tointeger() + return floor( GameTime_PlayingTime() / 60 ).tointeger() } int function GameTime_TimeLeftSeconds() @@ -4025,30 +4025,25 @@ int function GameTime_TimeLeftSeconds() if ( GetGameState() == eGameState.Prematch ) return int( expect float( GetServerVar( "gameStartTime" ) ) - Time() ) - return floor( GameTime_TimeLimitSeconds() - GameTime_PlayingTime() ).tointeger() + return GameTime_PlayingTime().tointeger() } +// WARN: this function includes WaitingForPlayers and Prematch duration! int function GameTime_Seconds() { return floor( Time() ).tointeger() } +// WARN: this function includes WaitingForPlayers Prematch duration! int function GameTime_Minutes() { return int( floor( GameTime_Seconds() / 60 ) ) } +// this function only counts the time limit during eGameState.Playing float function GameTime_PlayingTime() { - return GameTime_PlayingTimeSince( Time() ) -} - -float function GameTime_PlayingTimeSince( float sinceTime ) -{ int gameState = GetGameState() - - // temp fix because i have no fucking clue why this crashes - if ( gameState < eGameState.Playing ) return 0 @@ -4057,17 +4052,15 @@ float function GameTime_PlayingTimeSince( float sinceTime ) if ( gameState > eGameState.SuddenDeath ) return (expect float( GetServerVar( "roundEndTime" ) ) - expect float( GetServerVar( "roundStartTime" ) ) ) else - return sinceTime - expect float( GetServerVar( "roundStartTime" ) ) - + return floor( expect float( GetServerVar( "roundEndTime" ) ) - Time() ) } else { if ( gameState > eGameState.SuddenDeath ) return (expect float( GetServerVar( "gameEndTime" ) ) - expect float( GetServerVar( "gameStartTime" ) ) ) else - return sinceTime - expect float( GetServerVar( "gameStartTime" ) ) + return floor( expect float( GetServerVar( "gameEndTime" ) ) - Time() ) } - unreachable } @@ -4411,4 +4404,4 @@ bool function PlayerHasTitan( entity player ) return true return false -}
\ No newline at end of file +} |