From 9d95536da204bf92084bfb0dc24042b57b829180 Mon Sep 17 00:00:00 2001 From: Mikusch Date: Thu, 13 Apr 2023 14:49:43 +0200 Subject: [PATCH] Remove waiting for players period Fixes #25 --- README.md | 1 - addons/sourcemod/scripting/prophunt.sp | 10 +++------- addons/sourcemod/scripting/prophunt/dhooks.sp | 19 ------------------- addons/sourcemod/scripting/prophunt/events.sp | 4 +--- 4 files changed, 4 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 99d8b79..a9e0269 100644 --- a/README.md +++ b/README.md @@ -18,7 +18,6 @@ AlliedModders forum thread: https://forums.alliedmods.net/showthread.php?p=27712 * Dynamically calculated self-damage values depending on used weapon * Minimal weapon and class restrictions * Compatibility with almost any arena map without any additional configs -* Functional waiting for players period in arena mode * Highly configurable using ConVars and configuration files ## Requirements diff --git a/addons/sourcemod/scripting/prophunt.sp b/addons/sourcemod/scripting/prophunt.sp index dc7ae06..971d860 100644 --- a/addons/sourcemod/scripting/prophunt.sp +++ b/addons/sourcemod/scripting/prophunt.sp @@ -31,7 +31,7 @@ #pragma semicolon 1 #pragma newdecls required -#define PLUGIN_VERSION "1.7.1" +#define PLUGIN_VERSION "1.7.2" #define PLUGIN_TAG "[{orange}PropHunt{default}]" @@ -920,7 +920,7 @@ static bool TraceEntityFilter_IgnoreEntity(int entity, int mask, any data) return entity != data; } -static Action Timer_CheckStaticPropInfo(Handle timer) +static void Timer_CheckStaticPropInfo(Handle timer) { // Query every Hunter for r_staticpropinfo to prevent cheating for (int client = 1; client <= MaxClients; client++) @@ -928,11 +928,9 @@ static Action Timer_CheckStaticPropInfo(Handle timer) if (IsClientInGame(client) && !IsFakeClient(client) && TF2_GetClientTeam(client) == TFTeam_Hunters) QueryClientConVar(client, "r_staticpropinfo", ConVarQuery_StaticPropInfo, 0); } - - return Plugin_Continue; } -Action Timer_PrintChatTip(Handle timer) +void Timer_PrintChatTip(Handle timer) { static int count; @@ -953,6 +951,4 @@ Action Timer_PrintChatTip(Handle timer) count = 0; Timer_PrintChatTip(timer); } - - return Plugin_Continue; } diff --git a/addons/sourcemod/scripting/prophunt/dhooks.sp b/addons/sourcemod/scripting/prophunt/dhooks.sp index 6146e20..50d0210 100644 --- a/addons/sourcemod/scripting/prophunt/dhooks.sp +++ b/addons/sourcemod/scripting/prophunt/dhooks.sp @@ -35,8 +35,6 @@ static DynamicHook g_DHookFireProjectile; static DynamicHook g_DHookSmack; static DynamicHook g_DHookHasKnockback; -static int g_OldGameType; - void DHooks_Init(GameData gamedata) { g_DynamicDetours = new ArrayList(sizeof(DetourData)); @@ -47,7 +45,6 @@ void DHooks_Init(GameData gamedata) DHooks_AddDynamicDetour(gamedata, "CTFProjectile_GrapplingHook::HookTarget", DHookCallback_HookTarget_Pre, DHookCallback_HookTarget_Post); DHooks_AddDynamicDetour(gamedata, "CTFPlayerShared::Heal", DHookCallback_Heal_Pre, _); DHooks_AddDynamicDetour(gamedata, "CTFPistol_ScoutPrimary::Push", _, DHookCallback_Push_Post); - DHooks_AddDynamicDetour(gamedata, "CTeamplayRoundBasedRules::SetInWaitingForPlayers", DHookCallback_SetInWaitingForPlayers_Pre, DHookCallback_SetInWaitingForPlayers_Post); g_DHookSpawn = DHooks_AddDynamicHook(gamedata, "CBaseEntity::Spawn"); g_DHookTakeHealth = DHooks_AddDynamicHook(gamedata, "CBaseEntity::TakeHealth"); @@ -331,22 +328,6 @@ static MRESReturn DHookCallback_Push_Post(int weapon) return MRES_Ignored; } -static MRESReturn DHookCallback_SetInWaitingForPlayers_Pre(DHookParam params) -{ - // Re-enables waiting for player period - g_OldGameType = GameRules_GetProp("m_nGameType"); - GameRules_SetProp("m_nGameType", 0); - - return MRES_Ignored; -} - -static MRESReturn DHookCallback_SetInWaitingForPlayers_Post(DHookParam params) -{ - GameRules_SetProp("m_nGameType", g_OldGameType); - - return MRES_Ignored; -} - static MRESReturn DHookCallback_Spawn_Pre(int player) { // This needs to happen before the first call to CTFPlayer::GetMaxHealthForBuffing diff --git a/addons/sourcemod/scripting/prophunt/events.sp b/addons/sourcemod/scripting/prophunt/events.sp index 6604567..80c3a1b 100644 --- a/addons/sourcemod/scripting/prophunt/events.sp +++ b/addons/sourcemod/scripting/prophunt/events.sp @@ -224,7 +224,7 @@ static void EventHook_ArenaRoundStart(Event event, const char[] name, bool dontB } } -static Action Timer_PropPostSpawn(Handle timer, int serial) +static void Timer_PropPostSpawn(Handle timer, int serial) { int client = GetClientFromSerial(serial); if (client != 0) @@ -239,8 +239,6 @@ static Action Timer_PropPostSpawn(Handle timer, int serial) if (ph_prop_afterburn_immune.BoolValue) TF2_AddCondition(client, TFCond_AfterburnImmune); } - - return Plugin_Continue; } static Action Timer_RefreshControlPointBonus(Handle timer)