Skip to content

Commit

Permalink
Patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Mentrillum committed Dec 30, 2022
1 parent 349540c commit d48c15e
Show file tree
Hide file tree
Showing 5 changed files with 52 additions and 14 deletions.
43 changes: 42 additions & 1 deletion addons/sourcemod/scripting/include/sf2/profiles/profiles.inc
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ stock void PrecacheSound2(const char[] path, bool checkFile)
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand Down Expand Up @@ -72,6 +76,11 @@ stock void TryPrecacheBossProfileSoundPath(const char[] soundPath, bool disableW
*/
stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false, bool checkFile)
{
if (path[0] == '\0')
{
return;
}

char fixedPath[PLATFORM_MAX_PATH];

if (strncmp(path, "models/", 7, false) == 0 || strncmp(path, "models\\", 7, false) == 0)
Expand All @@ -93,6 +102,10 @@ stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false,
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -106,6 +119,10 @@ stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false,
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -124,6 +141,10 @@ stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false,
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -150,6 +171,10 @@ stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false,
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -163,6 +188,10 @@ stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false,
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -181,6 +210,10 @@ stock void PrecacheModel2(const char[] path, bool phy = true, bool xbox = false,
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -205,6 +238,10 @@ stock void PrecacheMaterial2(const char[] path, bool checkFile)
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand All @@ -217,6 +254,10 @@ stock void PrecacheMaterial2(const char[] path, bool checkFile)
{
AddFileToDownloadsTable(buffer);
}
else
{
PrintToServer("[SF2] File %s is missing from the server files!", buffer);
}
}
else
{
Expand Down Expand Up @@ -541,7 +582,7 @@ stock void SetProfileDifficultyStringArrayValues(KeyValues kv, const char[] base

for (int i = 0; i < Difficulty_Max; i++)
{
GetProfileKeyWithDifficultySuffix(baseKeyName, i, key, sizeof(key));
GetProfileKeyWithDifficultySuffix(baseKeyName, i == 0 ? 1 : i, key, sizeof(key));
char[] value = new char[PLATFORM_MAX_PATH];
kv.GetString(key, value, PLATFORM_MAX_PATH, temporaryKeys);
if (models && strncmp(value, "models/", 7, false) != 0 && strncmp(value, "models\\", 7, false) != 0 && value[0] != '\0')
Expand Down
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/sf2/client.sp
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,10 @@ public Action TF2_CalcIsAttackCritical(int client, int weapon, char[] weaponName
}
}

if (g_PlayerProxy[client])
if (g_PlayerProxy[client] && !IsClientCritBoosted(client))
{
result = false;
return Plugin_Changed;
return Plugin_Handled;
}

return Plugin_Continue;
Expand Down
13 changes: 5 additions & 8 deletions addons/sourcemod/scripting/sf2/functionclients/client_music.sp
Original file line number Diff line number Diff line change
Expand Up @@ -177,17 +177,14 @@ void ClientUpdateMusicSystem(int client, bool initialize=false)
chasingBoss = i;
}

if ((g_SlenderState[i] == STATE_CHASE || g_SlenderState[i] == STATE_ATTACK) &&
if ((g_SlenderState[i] == STATE_CHASE || g_SlenderState[i] == STATE_ATTACK || g_SlenderState[i] == STATE_STUN) &&
PlayerCanSeeSlender(client, i, false))
{
if (oldChasingSeeBoss == -1 || !PlayerCanSeeSlender(client, oldChasingSeeBoss, false))
GetChaserProfileChaseVisibleMusics(profile, soundInfo);
soundList = soundInfo.Paths;
if (soundList != null && soundList.Length > 0)
{
GetChaserProfileChaseVisibleMusics(profile, soundInfo);
soundList = soundInfo.Paths;
if (soundList != null && soundList.Length > 0)
{
chasingSeeBoss = i;
}
chasingSeeBoss = i;
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions addons/sourcemod/scripting/sf2/profiles/profile_statue.sp
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ bool LoadStatueBossProfile(KeyValues kv, const char[] profile, char[] loadFailRe
for (int i = 0; i < profileData.ModelsAverageDist.Length; i++)
{
profileData.ModelsAverageDist.GetString(i, modelName, sizeof(modelName));
if (modelName[0] != '\0' && strcmp(modelName[0], "models/", true) != 0 && strcmp(modelName[0], "models\\", true) != 0)
if (modelName[0] != '\0' && strcmp(modelName, "models/", true) != 0 && strcmp(modelName, "models\\", true) != 0)
{
PrecacheModel2(modelName, _, _, g_FileCheckConVar.BoolValue);
}
}
for (int i = 0; i < profileData.ModelsCloseDist.Length; i++)
{
profileData.ModelsCloseDist.GetString(i, modelName, sizeof(modelName));
if (modelName[0] != '\0' && strcmp(modelName[0], "models/", true) != 0 && strcmp(modelName[0], "models\\", true) != 0)
if (modelName[0] != '\0' && strcmp(modelName, "models/", true) != 0 && strcmp(modelName, "models\\", true) != 0)
{
PrecacheModel2(modelName, _, _, g_FileCheckConVar.BoolValue);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ bool LoadBossProfile(KeyValues kv, const char[] profile, char[] loadFailReasonBu
for (int i = 0; i < profileData.Models.Length; i++)
{
profileData.Models.GetString(i, modelName, sizeof(modelName));
if (modelName[0] != '\0' && strcmp(modelName[0], "models/", true) != 0 && strcmp(modelName[0], "models\\", true) != 0)
if (modelName[0] != '\0' && strcmp(modelName, "models/", true) != 0 && strcmp(modelName, "models\\", true) != 0)
{
PrecacheModel2(modelName, _, _, g_FileCheckConVar.BoolValue);
}
Expand Down

0 comments on commit d48c15e

Please sign in to comment.