Skip to content

Commit

Permalink
Merge branch 'master' into dev
Browse files Browse the repository at this point in the history
# Conflicts:
#	src/scripting/AS-MicroTF2.sp
  • Loading branch information
safalin1 committed Feb 25, 2024
2 parents 3d2b23a + b2d1d9f commit d651054
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 4 deletions.
19 changes: 18 additions & 1 deletion src/scripting/ConVars.sp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ ConVar g_hConVarPluginForceMinigame;
ConVar g_hConVarPluginForceBossgame;
ConVar g_hConVarPluginForceBossgameThreshold;
ConVar g_hConVarPluginMaxRounds;
ConVar g_hConVarWaitingForPlayersTime;

void InitializeConVars()
{
Expand All @@ -50,6 +51,7 @@ void InitializeConVars()
g_hConVarPluginIntermissionEnabled = CreateConVar("mtf2_intermission_enabled", "1", "Controls whether or not intermission is to be held half way through the maximum round count. Having Intermission enabled assumes you have a intermission integration enabled - for example the SourceMod Mapchooser integration.", 0, true, 0.0, true, 1.0);
g_hConVarPluginBonusPoints = CreateConVar("mtf2_bonuspoints", "0", "Controls whether or not minigames should have a bonus point.", 0, true, 0.0, true, 1.0);
g_hConVarPluginAllowCosmetics = CreateConVar("mtf2_cosmetics_enabled", "0", "Allows cosmetics to be worn by players. NOTE: This mode is explicitly not supported and may cause visual bugs and possible server lag spikes.", 0, true, 0.0, true, 1.0);
g_hConVarWaitingForPlayersTime = CreateConVar("mtf2_waitingforplayers_time", "60", "Sets the amount of time (in seconds) to wait for players to join after the map loads.", 0, true, 10.0);

if (g_hConVarPluginMaxRounds != INVALID_HANDLE)
{
Expand All @@ -61,6 +63,11 @@ void InitializeConVars()
HookConVarChange(g_hConVarPluginAllowCosmetics, OnAllowCosmeticsChanged);
}

if (g_hConVarWaitingForPlayersTime != INVALID_HANDLE)
{
HookConVarChange(g_hConVarWaitingForPlayersTime, OnWaitingForPlayersTimeChanged);
}

// Debugging ConVars / Commands. You don't really want these set all the time.
g_hConVarPluginForceMinigame = CreateConVar("mtf2_debug_forceminigame", "0", "Forces a minigame to always be played. If 0, no minigame will be forced. This cvar is used only when debugging.", 0, true, 0.0);
g_hConVarPluginForceBossgame = CreateConVar("mtf2_debug_forcebossgame", "0", "Forces a bossgame to always be played. If 0, no bossgame will be forced. This cvar is used only when debugging.", 0, true, 0.0);
Expand Down Expand Up @@ -105,7 +112,7 @@ void PrepareConVars()
// Multiplayer ConVars
SetConVarInt(FindConVar("mp_stalemate_enable"), 0);
SetConVarInt(FindConVar("mp_friendlyfire"), 1);
SetConVarInt(FindConVar("mp_waitingforplayers_time"), 90);
SetConVarInt(FindConVar("mp_waitingforplayers_time"), g_hConVarWaitingForPlayersTime.IntValue);
SetConVarInt(FindConVar("mp_disable_respawn_times"), 0);
SetConVarInt(FindConVar("mp_respawnwavetime"), 9999);
SetConVarInt(FindConVar("mp_idlemaxtime"), 8);
Expand Down Expand Up @@ -139,6 +146,16 @@ public void OnAllowCosmeticsChanged(Handle cvar, const char[] oldVal, const char
g_bAllowCosmetics = value == 1;
}

public void OnWaitingForPlayersTimeChanged(Handle cvar, const char[] oldVal, const char[] newVal)
{
if (g_bIsPluginEnabled)
{
int value = StringToInt(newVal);

SetConVarInt(FindConVar("mp_waitingforplayers_time"), value);
}
}

public bool Config_BonusPointsEnabled()
{
return g_hConVarPluginBonusPoints.BoolValue;
Expand Down
6 changes: 3 additions & 3 deletions src/scripting/Minigames/HitTheTarget.sp
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ public void Minigame18_OnMinigameSelected(int client)
float ang[3] = { 0.0, 90.0, 0.0 };
float pos[3];

int column = client;
int row = 0;
int column = (client - 1) % 32;
int row = ((client - 1) / 32) % 2;

pos[0] = 10406.0 + float(column*60);
pos[0] = 10466.0 + float(column*60);
pos[1] = 7100.0 - float(row*100);
pos[2] = -260.0;

Expand Down

0 comments on commit d651054

Please sign in to comment.