| 966 | */ |
| 967 | |
| 968 | static void AS_UpdateCurrentSet( int id ) { |
| 969 | if ( !aSets ) { |
| 970 | return; |
| 971 | } |
| 972 | |
| 973 | //Check for a change |
| 974 | if ( id != currentSet ) { |
| 975 | //This is new, so start the fading |
| 976 | oldSet = currentSet; |
| 977 | currentSet = id; |
| 978 | |
| 979 | ambientSet_t *current = aSets->GetSet( currentSet ); |
| 980 | // Ste, I just put this null check in for now, not sure if there's a more graceful way to exit this function - dmv |
| 981 | if ( !current ) { |
| 982 | return; |
| 983 | } |
| 984 | |
| 985 | ambientSet_t *old = aSets->GetSet( oldSet ); |
| 986 | if ( old ) { |
| 987 | old->masterVolume = MAX_SET_VOLUME; |
| 988 | old->fadeTime = cls.realtime; |
| 989 | } |
| 990 | |
| 991 | current->masterVolume = 0; |
| 992 | |
| 993 | //Set the fading starts |
| 994 | current->fadeTime = cls.realtime; |
| 995 | } |
| 996 | |
| 997 | //Update their volumes if fading |
| 998 | AS_UpdateSetVolumes(); |
| 999 | } |
| 1000 | |
| 1001 | /* |
| 1002 | ------------------------- |
no test coverage detected