Skip to content

Commit

Permalink
bench
Browse files Browse the repository at this point in the history
  • Loading branch information
rayzerbrain committed May 30, 2022
1 parent bddfc5e commit a3ff810
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ShootingRange/API/SpectatorRange.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Exiled.API.Features;
using Exiled.API.Features.Toys;
using Exiled.API.Extensions;
using Mirror;

namespace ShootingRange.API
{
Expand Down Expand Up @@ -97,11 +98,16 @@ public void SpawnPrimitives()
{
prims[i].Color = color;
prims[i].Type = PrimitiveType.Cube;

// This is due to an issue with exiled spawned primitives being able to be shot through.
//prims[i].Base.NetworkScale = prims[i].Scale;
}
}
public void SpawnBench()
{
Quaternion rot = Quaternion.Euler(0, 180, 0);
Vector3 pos = new((_bigBound.x + _smallBound.x) / 2, _smallBound.y + 0.25f, _bigBound.z - 1);

GameObject benchPrefab = NetworkClient.prefabs[System.Guid.Parse("307eb9b0-d080-9dc4-78e6-673847876412")];
NetworkServer.Spawn(Object.Instantiate(benchPrefab, pos, rot));
}
public void RemovePlayer(Player plyr)
{
plyr.ClearInventory();
Expand Down
1 change: 1 addition & 0 deletions ShootingRange/EventHandlers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public void OnRoundStarted()
{
SpectatorRange range = _plugin.Config.UseRangeLocation ? new SpectatorRange(_plugin.Config.RangeLocation) : new SpectatorRange();
range.SpawnTargets();
range.SpawnBench();

if (_plugin.Config.UsePrimitives)
range.SpawnPrimitives();
Expand Down

0 comments on commit a3ff810

Please sign in to comment.