Skip to content

Commit

Permalink
Remove waiting for players period
Browse files Browse the repository at this point in the history
Fixes #25
  • Loading branch information
Mikusch committed Apr 13, 2023
1 parent 985808f commit 9d95536
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 30 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 3 additions & 7 deletions addons/sourcemod/scripting/prophunt.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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}]"

Expand Down Expand Up @@ -920,19 +920,17 @@ 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++)
{
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;

Expand All @@ -953,6 +951,4 @@ Action Timer_PrintChatTip(Handle timer)
count = 0;
Timer_PrintChatTip(timer);
}

return Plugin_Continue;
}
19 changes: 0 additions & 19 deletions addons/sourcemod/scripting/prophunt/dhooks.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand All @@ -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");
Expand Down Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions addons/sourcemod/scripting/prophunt/events.sp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down

0 comments on commit 9d95536

Please sign in to comment.