Skip to content

Commit d1ed96a

Browse files
committed
fixed SCP1499 bug
1 parent 7807c21 commit d1ed96a

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

MoreWeapons/EventHandlers.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private void OnItemUse(PlayerItemInteractEventArgs ev)
6565
break;
6666

6767
case (int)CustomItemType.Scp1499 when ev.State == Synapse.Api.Events.SynapseEventArguments.ItemInteractState.Finalizing:
68-
ev.Player.GetComponent<Scp1499PlayerScript>().Use1499();
68+
ev.Player.GetComponent<Scp1499PlayerScript>().Use1499(ev.CurrentItem);
6969
ev.Allow = false;
7070
break;
7171
}

MoreWeapons/PluginClass.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ namespace MoreWeapons
1111
Description = "A Plugin that adds new Weapons & Items to the Game",
1212
LoadPriority = 100,
1313
SynapseMajor = 2,
14-
SynapseMinor = 8,
15-
SynapsePatch = 3,
14+
SynapseMinor = 9,
15+
SynapsePatch = 0,
1616
Version = "1.3.2"
1717
)]
1818
public class PluginClass : AbstractPlugin

MoreWeapons/Scripts/Scp1499PlayerScript.cs

+8-7
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
using MEC;
44
using Synapse.Api;
55
using Synapse.Api.Enum;
6+
using Synapse.Api.Items;
67
using UnityEngine;
78

89
namespace MoreWeapons.Scripts
@@ -17,7 +18,7 @@ public class Scp1499PlayerScript : MonoBehaviour
1718

1819
public bool IsInDimension { get; set; } = false;
1920

20-
public void Use1499()
21+
public void Use1499(SynapseItem scp1499)
2122
{
2223
if (player.Zone == ZoneType.Pocket)
2324
{
@@ -34,7 +35,7 @@ public void Use1499()
3435

3536
IsInDimension = false;
3637

37-
(player.ItemInHand?.ItemBase as Scp268)?.ServerSetGlobalItemCooldown(PluginClass.Scp1499Config.Cooldown);
38+
(scp1499?.ItemBase as Scp268)?.ServerSetGlobalItemCooldown(PluginClass.Scp1499Config.Cooldown);
3839

3940
Timing.KillCoroutines(kickcoroutine.ToArray());
4041
}
@@ -44,25 +45,25 @@ public void Use1499()
4445
OldPosition = player.Position;
4546
player.Position = PluginClass.Scp1499Config.Scp1499Dimension.Parse().Position;
4647

47-
KickOut(PluginClass.Scp1499Config.Scp1499ResidenceTime);
48+
KickOut(PluginClass.Scp1499Config.Scp1499ResidenceTime,scp1499);
4849
IsInDimension = true;
4950
}
5051
}
5152

52-
public void KickOut(float delay)
53+
public void KickOut(float delay, SynapseItem scp1499)
5354
{
5455
if (delay < 0f) return;
55-
kickcoroutine.Add(Timing.RunCoroutine(KickOutOfScp1499(delay)));
56+
kickcoroutine.Add(Timing.RunCoroutine(KickOutOfScp1499(delay,scp1499)));
5657
}
5758

5859
private readonly List<CoroutineHandle> kickcoroutine = new List<CoroutineHandle>();
5960

60-
private IEnumerator<float> KickOutOfScp1499(float delay)
61+
private IEnumerator<float> KickOutOfScp1499(float delay, SynapseItem scp1499)
6162
{
6263
yield return Timing.WaitForSeconds(delay);
6364

6465
if (IsInDimension)
65-
Use1499();
66+
Use1499(scp1499);
6667
}
6768
}
6869
}

0 commit comments

Comments
 (0)