Skip to content

Commit 6eaaeb7

Browse files
committed
fix: TeleportFix logic was wrong
chore: bumped dependencies
1 parent c6c1afc commit 6eaaeb7

6 files changed

Lines changed: 17 additions & 8 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
.idea
22
CS2-Essentials/obj
33
CS2-Essentials/bin
4+
*.user

CS2-Essentials/CS2-Essentials.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
</PropertyGroup>
1010

1111
<ItemGroup>
12-
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.346" />
13-
<PackageReference Include="CS2-CustomVotes.Shared" Version="1.1.3" />
12+
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.352" />
13+
<PackageReference Include="CS2-CustomVotes.Shared" Version="1.1.4" />
1414
<PackageReference Include="CSSharpUtils" Version="1.0.9" />
1515
</ItemGroup>
1616
</Project>

CS2-Essentials/Extensions/QAngleExtensions.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ public static class QAngleExtensions
44
{
55
public static bool IsValid(this CounterStrikeSharp.API.Modules.Utils.QAngle angle)
66
{
7-
return angle.IsFinite() && !angle.IsNaN() && angle.IsReasonable();
7+
return angle.IsFinite() && !angle.IsNaN() && angle.IsAllowed();
88
}
99

1010
private static bool IsFinite(this CounterStrikeSharp.API.Modules.Utils.QAngle angle)
@@ -49,7 +49,7 @@ private static void FixNaN(this CounterStrikeSharp.API.Modules.Utils.QAngle angl
4949

5050
private static void Clamp(this CounterStrikeSharp.API.Modules.Utils.QAngle angle)
5151
{
52-
angle.X = Math.Clamp(angle.X, -179.0f, 179.0f);
52+
angle.X = Math.Clamp(angle.X, -179.9f, 179.9f);
5353
angle.Y = Math.Clamp(angle.Y, -180.0f, 180.0f);
5454
}
5555

@@ -68,4 +68,12 @@ q.X is > -r and < r &&
6868
q.Y is > -r and < r &&
6969
q.Z is > -r and < r;
7070
}
71+
72+
private static bool IsAllowed(this CounterStrikeSharp.API.Modules.Utils.QAngle q)
73+
{
74+
return
75+
q.X is >= -179.9f and <= 179.9f &&
76+
q.Y is >= -180.0f and <= 180.0f &&
77+
q.Z is >= -180.0f and <= 180.0f;
78+
}
7179
}

CS2-Essentials/Features/FriendlyFire.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@ public static void RegisterCustomVotes(Plugin plugin)
4141
30,
4242
new Dictionary<string, VoteOption>
4343
{
44-
{ "Enable", new("{Green}Enable", new List<string> { "hvh_unmatched_friendlyfire 0" })},
45-
{ "Disable", new("{Red}Disable", new List<string> { "hvh_unmatched_friendlyfire 1" })},
44+
{ "Enable", new VoteOption("{Green}Enable", ["hvh_unmatched_friendlyfire 0"])},
45+
{ "Disable", new VoteOption("{Red}Disable", ["hvh_unmatched_friendlyfire 1"])},
4646
},
4747
plugin.Config.CustomVoteSettings.Style);
4848
}

CS2-Essentials/Plugin.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ namespace hvhgg_essentials;
1313
public class Plugin : BasePlugin, IPluginConfig<Cs2EssentialsConfig>
1414
{
1515
public override string ModuleName => "HvH.gg - Essentials";
16-
public override string ModuleVersion => "1.2.9";
16+
public override string ModuleVersion => "1.3.0";
1717
public override string ModuleAuthor => "imi-tat0r";
1818
public override string ModuleDescription => "Essential features for CS2 HvH servers";
1919
public Cs2EssentialsConfig Config { get; set; } = new();

README.MD

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
![Copyright ev0lve Digital](https://img.shields.io/badge/Copyright-ev0lve%20Digital-blue) ![GitHub License](https://img.shields.io/github/license/HvH-gg/CS2-Essentials) ![Issues](https://img.shields.io/github/issues/HvH-gg/CS2-Essentials) ![Downloads](https://img.shields.io/github/downloads/HvH-gg/CS2-Essentials/total) ![Stars](https://img.shields.io/github/stars/HvH-gg/CS2-Essentials)
22

3-
# [HvH.gg](https://hvh.gg) CS2 Essentials (1.2.9)
3+
# [HvH.gg](https://hvh.gg) CS2 Essentials (1.3.0)
44
### If you use this plugin, you do NOT need [RapidFireFix](https://github.com/HvH-gg/RapidFireFix) anymore.
55

66
Our CS2 Essentials plugin is the only plugin you need to run a successful HvH server. It includes basic features like **reset score** and **rage quit** as well as optional restrictions for **weapons**, **friendly fire**, **rapid fire** and other exploit/crash fixes.

0 commit comments

Comments
 (0)