Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal78900 committed Aug 31, 2021
1 parent b9d991d commit 06769c6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 14 deletions.
18 changes: 7 additions & 11 deletions WaitAndChillReborn/Handler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ internal void OnWaitingForPlayers()
Scp173.TurnedPlayers.Clear();
Scp096.TurnedPlayers.Clear();

ffPrevValue = Server.FriendlyFire;
Server.FriendlyFire = true;
if (Config.AllowFriendlyFire)
{
ffPrevValue = Server.FriendlyFire;
Server.FriendlyFire = true;
}

GameObject.Find("StartRound").transform.localScale = Vector3.zero;

Expand Down Expand Up @@ -164,14 +167,6 @@ internal void OnDroppingItem(DroppingItemEventArgs ev)
}
}

internal void OnPickingupItem(PickingUpItemEventArgs ev)
{
if (ev.Player.Role == RoleType.ClassD)
{
ev.IsAllowed = false;
}
}

internal void OnInteractingDoor(InteractingDoorEventArgs ev)
{
if (IsLobby)
Expand Down Expand Up @@ -216,7 +211,8 @@ internal void OnTeleporting(TeleportingEventArgs ev)

internal void OnRoundStarted()
{
Server.FriendlyFire = ffPrevValue;
if (Config.AllowFriendlyFire)
Server.FriendlyFire = ffPrevValue;

foreach (ThrownProjectile throwable in Object.FindObjectsOfType<ThrownProjectile>())
{
Expand Down
4 changes: 1 addition & 3 deletions WaitAndChillReborn/Plugin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public override void OnEnabled()
PlayerEvent.SpawningRagdoll += handler.OnSpawningRagdoll;
PlayerEvent.IntercomSpeaking += handler.OnIntercom;
PlayerEvent.DroppingItem += handler.OnDroppingItem;
PlayerEvent.PickingUpItem += handler.OnPickingupItem;
PlayerEvent.InteractingDoor += handler.OnInteractingDoor;
PlayerEvent.InteractingElevator += handler.OnInteractingElevator;
PlayerEvent.InteractingLocker += handler.OnInteractingLocker;
Expand All @@ -62,7 +61,6 @@ public override void OnDisabled()
PlayerEvent.SpawningRagdoll -= handler.OnSpawningRagdoll;
PlayerEvent.IntercomSpeaking -= handler.OnIntercom;
PlayerEvent.DroppingItem -= handler.OnDroppingItem;
PlayerEvent.PickingUpItem -= handler.OnPickingupItem;
PlayerEvent.InteractingDoor -= handler.OnInteractingDoor;
PlayerEvent.InteractingElevator -= handler.OnInteractingElevator;
PlayerEvent.InteractingLocker -= handler.OnInteractingLocker;
Expand All @@ -80,7 +78,7 @@ public override void OnDisabled()

public override string Name => "WaitAndChillReborn";
public override string Author => "Michal78900";
public override Version Version => new Version(3, 0, 0);
public override Version Version => new Version(3, 0, 1);
public override Version RequiredExiledVersion => new Version(3, 0, 0);
}
}

0 comments on commit 06769c6

Please sign in to comment.