|
@@ -12,7 +12,7 @@
|
|
|
#pragma newdecls required
|
|
|
#include <round_end_music>
|
|
|
|
|
|
-#define PLUGIN_VERSION "0.4.0"
|
|
|
+#define PLUGIN_VERSION "0.4.1"
|
|
|
public Plugin myinfo = {
|
|
|
name = "[CSRD] Round End Music",
|
|
|
author = "nosoop",
|
|
@@ -91,7 +91,6 @@ void PrintSongList(int client, const char[] listName, ArrayList songList) {
|
|
|
}
|
|
|
|
|
|
public void OnConfigsExecuted() {
|
|
|
- // TODO pull g_nMaxActiveSongs from ConVar -- it can't change during map
|
|
|
g_nMaxActiveSongs = g_ConVarMaxActiveSongs.IntValue;
|
|
|
g_bRoundEndMusicActive = g_ConVarEnabled.BoolValue;
|
|
|
|
|
@@ -255,7 +254,12 @@ void FireOnREMPlayedPostEvent(MusicEntry song) {
|
|
|
}
|
|
|
|
|
|
public void OnRoundEnd(Event event, const char[] name, bool dontBroadcast) {
|
|
|
- CreateTimer(g_ConVarSongDelay.FloatValue, RoundEndMusicPlaybackDelay);
|
|
|
+ float flSongDelay = g_ConVarSongDelay.FloatValue, flBonusRoundTime = GetBonusRoundTime();
|
|
|
+
|
|
|
+ // Enforce checking of song delay.
|
|
|
+ flSongDelay = flSongDelay > flBonusRoundTime? flBonusRoundTime : flSongDelay;
|
|
|
+
|
|
|
+ CreateTimer(flSongDelay, RoundEndMusicPlaybackDelay, _, TIMER_FLAG_NO_MAPCHANGE);
|
|
|
}
|
|
|
|
|
|
public Action RoundEndMusicPlaybackDelay(Handle timer, any data) {
|
|
@@ -266,6 +270,11 @@ public Action RoundEndMusicPlaybackDelay(Handle timer, any data) {
|
|
|
// that *should* maintain initial play order
|
|
|
// maybe we should just provide a function that provides the entire list and active counts?
|
|
|
|
|
|
+/* Utility functions */
|
|
|
+float GetBonusRoundTime() {
|
|
|
+ return FindConVar("mp_bonusroundtime").FloatValue;
|
|
|
+}
|
|
|
+
|
|
|
/* Native function calls */
|
|
|
public APLRes AskPluginLoad2(Handle self, bool late, char[] error, int err_max) {
|
|
|
RegPluginLibrary("round-end-music");
|