3
3
using MEC ;
4
4
using Synapse . Api ;
5
5
using Synapse . Api . Enum ;
6
+ using Synapse . Api . Items ;
6
7
using UnityEngine ;
7
8
8
9
namespace MoreWeapons . Scripts
@@ -17,7 +18,7 @@ public class Scp1499PlayerScript : MonoBehaviour
17
18
18
19
public bool IsInDimension { get ; set ; } = false ;
19
20
20
- public void Use1499 ( )
21
+ public void Use1499 ( SynapseItem scp1499 )
21
22
{
22
23
if ( player . Zone == ZoneType . Pocket )
23
24
{
@@ -34,7 +35,7 @@ public void Use1499()
34
35
35
36
IsInDimension = false ;
36
37
37
- ( player . ItemInHand ? . ItemBase as Scp268 ) ? . ServerSetGlobalItemCooldown ( PluginClass . Scp1499Config . Cooldown ) ;
38
+ ( scp1499 ? . ItemBase as Scp268 ) ? . ServerSetGlobalItemCooldown ( PluginClass . Scp1499Config . Cooldown ) ;
38
39
39
40
Timing . KillCoroutines ( kickcoroutine . ToArray ( ) ) ;
40
41
}
@@ -44,25 +45,25 @@ public void Use1499()
44
45
OldPosition = player . Position ;
45
46
player . Position = PluginClass . Scp1499Config . Scp1499Dimension . Parse ( ) . Position ;
46
47
47
- KickOut ( PluginClass . Scp1499Config . Scp1499ResidenceTime ) ;
48
+ KickOut ( PluginClass . Scp1499Config . Scp1499ResidenceTime , scp1499 ) ;
48
49
IsInDimension = true ;
49
50
}
50
51
}
51
52
52
- public void KickOut ( float delay )
53
+ public void KickOut ( float delay , SynapseItem scp1499 )
53
54
{
54
55
if ( delay < 0f ) return ;
55
- kickcoroutine . Add ( Timing . RunCoroutine ( KickOutOfScp1499 ( delay ) ) ) ;
56
+ kickcoroutine . Add ( Timing . RunCoroutine ( KickOutOfScp1499 ( delay , scp1499 ) ) ) ;
56
57
}
57
58
58
59
private readonly List < CoroutineHandle > kickcoroutine = new List < CoroutineHandle > ( ) ;
59
60
60
- private IEnumerator < float > KickOutOfScp1499 ( float delay )
61
+ private IEnumerator < float > KickOutOfScp1499 ( float delay , SynapseItem scp1499 )
61
62
{
62
63
yield return Timing . WaitForSeconds ( delay ) ;
63
64
64
65
if ( IsInDimension )
65
- Use1499 ( ) ;
66
+ Use1499 ( scp1499 ) ;
66
67
}
67
68
}
68
69
}
0 commit comments