Skip to content

Commit

Permalink
fix: AutoExpander to 32 units
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-wos committed Jul 28, 2024
1 parent 713fab4 commit a0d0406
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
14 changes: 10 additions & 4 deletions src/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,17 @@ private HookResult OnBulletImpact(EventBulletImpact @event, GameEventInfo info)
var diffY = Math.Abs(value.AddZone.Points[0].Y - value.AddZone.Points[1].Y);
var diffZ = Math.Abs(value.AddZone.Points[0].Z - value.AddZone.Points[1].Z);

if (diffX < 10)
value.AddZone.Points[0].X += 10 - diffX;
if (diffX < 32)
{
value.AddZone.Points[0].X += (value.AddZone.Points[0].X >= value.AddZone.Points[1].X ? 1 : -1) * ((32 - diffX) / 2);
value.AddZone.Points[1].X += (value.AddZone.Points[0].X > value.AddZone.Points[1].X ? -1 : 1) * ((32 - diffX) / 2);
}

if (diffY < 10)
value.AddZone.Points[0].Y += 10 - diffY;
if (diffY < 32)
{
value.AddZone.Points[0].Y += (value.AddZone.Points[0].Y >= value.AddZone.Points[1].Y ? 1 : -1) * ((32 - diffY) / 2);
value.AddZone.Points[1].Y += (value.AddZone.Points[0].Y > value.AddZone.Points[1].Y ? -1 : 1) * ((32 - diffY) / 2);
}

if (diffZ < 200)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Globals.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace AntiRush;
public partial class AntiRush
{
public override string ModuleName => "AntiRush";
public override string ModuleVersion => "1.0.4";
public override string ModuleVersion => "1.0.5";
public override string ModuleAuthor => "https://github.com/oscar-wos/AntiRush";
public AntiRushConfig Config { get; set; } = new();
public Menu.Menu Menu { get; } = new();
Expand Down

0 comments on commit a0d0406

Please sign in to comment.