Skip to content

Commit

Permalink
feat: Add floor zoning
Browse files Browse the repository at this point in the history
  • Loading branch information
oscar-wos committed Jun 27, 2024
1 parent db06e84 commit 2dedd71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/AntiRush.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ private void SaveZone(CCSPlayerController controller)

private bool DoAction(CCSPlayerController controller, Zone zone)
{
if (zone.Type != ZoneType.Bounce && Server.CurrentTime - _playerData[controller].LastMessage > 1)
if (zone.Type != ZoneType.Bounce && Server.CurrentTime - _playerData[controller].LastMessage >= 1)
controller!.PrintToChat($"{Prefix}{FormatZoneString(zone.Type)}");

_playerData[controller].LastMessage = Server.CurrentTime;
Expand Down
10 changes: 10 additions & 0 deletions src/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,18 @@ private HookResult OnBulletImpact(EventBulletImpact @event, GameEventInfo info)
if (value.AddZone.Points[0].IsZero())
value.AddZone.Points[0] = new Vector(@event.X, @event.Y, @event.Z);
else if (value.AddZone.Points[1].IsZero())
{
value.AddZone.Points[1] = new Vector(@event.X, @event.Y, @event.Z);

if (Math.Abs(value.AddZone.Points[0].Z - value.AddZone.Points[1].Z) < 76)
{
if (value.AddZone.Points[0].Z >= value.AddZone.Points[1].Z)
value.AddZone.Points[0].Z += 150;
else
value.AddZone.Points[1].Z += 150;
}
}

Menu.PopMenu(controller!, value.AddZone);
BuildAddZoneMenu(controller!);

Expand Down

0 comments on commit 2dedd71

Please sign in to comment.