From 4364ba46e208d583689d8122cdd4e88002cf439b Mon Sep 17 00:00:00 2001 From: Fyren Date: Wed, 18 Mar 2009 22:10:39 -0700 Subject: [PATCH] Switch base plugins to APL2; disable nextmap for L4D, Dystopia, Synergy (bugs 3716, 3687, 3741; r=pred) --- plugins/adminmenu.sp | 4 ++-- plugins/mapchooser.sp | 4 ++-- plugins/nextmap.sp | 30 ++++++++++++++++++------------ 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/plugins/adminmenu.sp b/plugins/adminmenu.sp index cba49d94..77a3c804 100644 --- a/plugins/adminmenu.sp +++ b/plugins/adminmenu.sp @@ -61,13 +61,13 @@ new TopMenuObject:obj_votingcmds = INVALID_TOPMENUOBJECT; #include "adminmenu/dynamicmenu.sp" -public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max) +public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) { CreateNative("GetAdminTopMenu", __GetAdminTopMenu); CreateNative("AddTargetsToMenu", __AddTargetsToMenu); CreateNative("AddTargetsToMenu2", __AddTargetsToMenu2); RegPluginLibrary("adminmenu"); - return true; + return APLRes_Success; } public OnPluginStart() diff --git a/plugins/mapchooser.sp b/plugins/mapchooser.sp index 8590fcd0..7254ddee 100644 --- a/plugins/mapchooser.sp +++ b/plugins/mapchooser.sp @@ -159,7 +159,7 @@ public OnPluginStart() g_NominationsResetForward = CreateGlobalForward("OnNominationRemoved", ET_Ignore, Param_String, Param_Cell); } -public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max) +public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) { RegPluginLibrary("mapchooser"); @@ -170,7 +170,7 @@ public bool:AskPluginLoad(Handle:myself, bool:late, String:error[], err_max) CreateNative("GetExcludeMapList", Native_GetExcludeMapList); CreateNative("EndOfMapVoteEnabled", Native_EndOfMapVoteEnabled); - return true; + return APLRes_Success; } public OnConfigsExecuted() diff --git a/plugins/nextmap.sp b/plugins/nextmap.sp index 3dde38ea..4e1dea78 100644 --- a/plugins/nextmap.sp +++ b/plugins/nextmap.sp @@ -51,14 +51,26 @@ new Handle:g_MapList = INVALID_HANDLE; new g_MapListSerial = -1; new g_CurrentMapStartTime; - + +public APLRes:AskPluginLoad2(Handle:myself, bool:late, String:error[], err_max) +{ + decl String:game[128]; + GetGameFolderName(game, sizeof(game)); + + if (StrEqual(game, "left4dead", false) + || StrEqual(game, "dystopia", false) + || StrEqual(game, "synergy", false)) + { + strcopy(error, err_max, "Nextmap is incompatible with this game"); + return APLRes_SilentFailure; + } + + return APLRes_Success; +} + + public OnPluginStart() { - decl String:desc[128]; - GetGameFolderName(desc, sizeof(desc)); - - if (StrEqual(desc, "left4dead", false)) - return; LoadTranslations("common.phrases"); LoadTranslations("nextmap.phrases"); @@ -81,12 +93,6 @@ public OnMapStart() public OnConfigsExecuted() { - decl String:desc[128]; - GetGameFolderName(desc, sizeof(desc)); - - if (StrEqual(desc, "left4dead", false)) - return; - decl String:lastMap[64], String:currentMap[64]; GetNextMap(lastMap, sizeof(lastMap)); GetCurrentMap(currentMap, 64);