Skip to content

Commit 0269f15

Browse files
authored
LabAPI Update 14.0.3 (#439)
* No error for build * Fix Exiled * Fix RoundEnding * Now is fucking separated by default * CustomSubtitles * Missing IsCustomAnnouncement * Fix 3 patch & removal of CustomHealthStat * Fix UsingAndCancellingItemUse * Fix TogglingFlashlight * La Flemme ? * La flemme 2 * Fix ReservedSlotPatch * Fix PickingUpItem(PickingUpAmmo) * Fix Hurt event * Fix FlippingCoin & EscapingPocketDimension * Fix FailingEscapePocketDimension * EscapingAndEscaped fix patch * Fix UpgradingPlayer patch * Fix BeingObserved * Fix PlacingTantrum * Fix FinishingRecall * ChangingCamera (Not working) * putting again the event than i was lazzy to fix * Rework InteractingDoor Patch missing removing the Prefix part lol & SkillIssueFix * Remove useless using and warning disable * OUPS * if stupidity was me it's here (i am stupid) * Fixing Noclip with breakingchange * CustomHumeShieldStat * Fix InteractingGenerator * Fix ChangingCamera * Not finish * InteractingDoor swap CanInteract & IsAllowed back to normal * Player::Gravity * Gravity in wrong place * IHumeShieldRole for Human * Fix BlastDoors & add OpenBlastDoor * Fix SpawningRagdoll Scale & missing argument when modify * Now fix in LabAPI only * we will keep the funny Ragdoll scale * Fix Merge & Split Command * new workflow for LabAPI * NW_Documentation * SCP:SL LabAPI 14.0.3 * Fix One IL Error Patch (2 remain from previous update) * use Specific build for LabAPI * Miss updating this file
1 parent 088ba33 commit 0269f15

File tree

13 files changed

+62
-31
lines changed

13 files changed

+62
-31
lines changed

.github/workflows/labapi.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ defaults:
1616
env:
1717
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/LabAPI.zip
1818
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
19-
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe
19+
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/download/v1.8.0/EXILED-DLL-Archiver.exe
2020

2121
jobs:
2222

EXILED/Exiled.API/Features/Lockers/Chamber.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,13 @@ public Chamber(LockerChamber chamber, Locker locker)
7777
/// </summary>
7878
public IEnumerable<Pickup> ToBeSpawned
7979
{
80-
get => Base._toBeSpawned.Select(Pickup.Get);
80+
get => Base.ToBeSpawned.Select(Pickup.Get);
8181
set
8282
{
83-
Base._toBeSpawned.Clear();
83+
Base.ToBeSpawned.Clear();
8484

8585
foreach (Pickup pickup in value)
86-
Base._toBeSpawned.Add(pickup.Base);
86+
Base.ToBeSpawned.Add(pickup.Base);
8787
}
8888
}
8989

@@ -137,26 +137,26 @@ public bool UseMultipleSpawnpoints
137137
/// </remarks>
138138
public Transform Spawnpoint
139139
{
140-
get => Base._spawnpoint;
141-
set => Base._spawnpoint = value;
140+
get => Base.Spawnpoint;
141+
set => Base.Spawnpoint = value;
142142
}
143143

144144
/// <summary>
145145
/// Gets or sets a value indicating whether items should be spawned as soon as they one chamber is opened.
146146
/// </summary>
147147
public bool InitiallySpawn
148148
{
149-
get => Base._spawnOnFirstChamberOpening;
150-
set => Base._spawnOnFirstChamberOpening = value;
149+
get => Base.SpawnOnFirstChamberOpening;
150+
set => Base.SpawnOnFirstChamberOpening = value;
151151
}
152152

153153
/// <summary>
154154
/// Gets or sets the amount of time before a player can interact with the chamber again.
155155
/// </summary>
156156
public float Cooldown
157157
{
158-
get => Base._targetCooldown;
159-
set => Base._targetCooldown = value;
158+
get => Base.TargetCooldown;
159+
set => Base.TargetCooldown = value;
160160
}
161161

162162
/// <summary>
@@ -219,7 +219,7 @@ public void AddItemToSpawn(ItemType itemType, int quantity = 1, bool spawnIfIsOp
219219
continue;
220220
}
221221

222-
Base._toBeSpawned.Add(pickup.Base);
222+
Base.ToBeSpawned.Add(pickup.Base);
223223
}
224224
}
225225

EXILED/Exiled.API/Features/Lockers/Locker.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public void AddItem(Pickup item)
220220
// If the chamber is configured to spawn items on the first opening, add the item to the list of items to be spawned.
221221
// Otherwise, spawn the item immediately.
222222
if (chamber.InitiallySpawn)
223-
chamber.Base._toBeSpawned.Add(item.Base);
223+
chamber.Base.ToBeSpawned.Add(item.Base);
224224
else
225225
ItemDistributor.SpawnPickup(item.Base);
226226
}

EXILED/Exiled.API/Features/Player.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3535,7 +3535,7 @@ public void Teleport(object obj, Vector3 offset)
35353535
Teleport(locker.transform.position + Vector3.up + offset);
35363536
break;
35373537
case LockerChamber chamber:
3538-
Teleport(chamber._spawnpoint.position + Vector3.up + offset);
3538+
Teleport(chamber.Spawnpoint.position + Vector3.up + offset);
35393539
break;
35403540
case ElevatorChamber elevator:
35413541
Teleport(elevator.transform.position + Vector3.up + offset);

EXILED/Exiled.Events/EventArgs/Player/EscapingPocketDimensionEventArgs.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,27 @@ public class EscapingPocketDimensionEventArgs : IPlayerEvent, IDeniableEvent
2121
/// <summary>
2222
/// Initializes a new instance of the <see cref="EscapingPocketDimensionEventArgs" /> class.
2323
/// </summary>
24+
/// <param name="pocketDimensionTeleport">
25+
/// <inheritdoc cref="Teleporter" />
26+
/// </param>
2427
/// <param name="player">
2528
/// <inheritdoc cref="Player" />
2629
/// </param>
2730
/// <param name="position">
2831
/// <inheritdoc cref="TeleportPosition" />
2932
/// </param>
30-
public EscapingPocketDimensionEventArgs(Player player, Vector3 position)
33+
public EscapingPocketDimensionEventArgs(PocketDimensionTeleport pocketDimensionTeleport, Player player, Vector3 position)
3134
{
35+
Teleporter = pocketDimensionTeleport;
3236
Player = player;
3337
TeleportPosition = position;
3438
}
3539

40+
/// <summary>
41+
/// Gets the PocketDimensionTeleport the player walked into.
42+
/// </summary>
43+
public PocketDimensionTeleport Teleporter { get; }
44+
3645
/// <summary>
3746
/// Gets the player who's escaping the pocket dimension.
3847
/// </summary>

EXILED/Exiled.Events/EventArgs/Player/FailingEscapePocketDimensionEventArgs.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,25 @@ public class FailingEscapePocketDimensionEventArgs : IPlayerEvent, IDeniableEven
2121
/// <summary>
2222
/// Initializes a new instance of the <see cref="FailingEscapePocketDimensionEventArgs" /> class.
2323
/// </summary>
24+
/// <param name="pocketDimensionTeleport">
25+
/// <inheritdoc cref="Teleporter" />
26+
/// </param>
2427
/// <param name="player">
2528
/// <inheritdoc cref="Player" />
2629
/// </param>
2730
/// <param name="isAllowed">
2831
/// <inheritdoc cref="IsAllowed" />
2932
/// </param>
30-
public FailingEscapePocketDimensionEventArgs(Player player, bool isAllowed = true)
33+
public FailingEscapePocketDimensionEventArgs(PocketDimensionTeleport pocketDimensionTeleport, Player player, bool isAllowed = true)
3134
{
35+
Teleporter = pocketDimensionTeleport;
3236
Player = player;
3337
IsAllowed = isAllowed;
3438
}
3539

3640
/// <summary>
3741
/// Gets the PocketDimensionTeleport the player walked into.
3842
/// </summary>
39-
[Obsolete("can't be used")]
4043
public PocketDimensionTeleport Teleporter { get; }
4144

4245
/// <summary>

EXILED/Exiled.Events/Patches/Events/Player/EscapingPocketDimension.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ namespace Exiled.Events.Patches.Events.Player
2626
using static HarmonyLib.AccessTools;
2727

2828
/// <summary>
29-
/// Patches the <see cref="PocketDimensionTeleport.Exit(ReferenceHub)"/> method.
29+
/// Patches the <see cref="PocketDimensionTeleport.Exit(PocketDimensionTeleport, ReferenceHub)"/> method.
3030
/// Adds the <see cref="Handlers.Player.EscapingPocketDimension"/> event.
3131
/// </summary>
3232
[EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.EscapingPocketDimension))]
@@ -47,14 +47,17 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
4747
index,
4848
new[]
4949
{
50+
// pocketDimensionTeleport
51+
new CodeInstruction(OpCodes.Ldarg_0),
52+
5053
// referenceHub
51-
new CodeInstruction(OpCodes.Ldarg_0).MoveLabelsFrom(newInstructions[index]),
54+
new CodeInstruction(OpCodes.Ldarg_1).MoveLabelsFrom(newInstructions[index]),
5255

5356
// Scp106PocketExitFinder.GetBestExitPosition(fpcRole)
5457
new(OpCodes.Ldloc_0),
5558
new(OpCodes.Call, Method(typeof(Scp106PocketExitFinder), nameof(Scp106PocketExitFinder.GetBestExitPosition), new[] { typeof(IFpcRole) })),
5659

57-
// EscapingPocketDimensionEventArgs ev = new(Player, Vector3)
60+
// EscapingPocketDimensionEventArgs ev = new(PocketDimensionTeleport, Player, Vector3)
5861
new(OpCodes.Newobj, GetDeclaredConstructors(typeof(EscapingPocketDimensionEventArgs))[0]),
5962
new(OpCodes.Dup),
6063
new(OpCodes.Dup),

EXILED/Exiled.Events/Patches/Events/Player/FailingEscapePocketDimension.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ namespace Exiled.Events.Patches.Events.Player
2222
using static HarmonyLib.AccessTools;
2323

2424
/// <summary>
25-
/// Patches <see cref="PocketDimensionTeleport.Kill(ReferenceHub)" />.
25+
/// Patches <see cref="PocketDimensionTeleport.Kill(PocketDimensionTeleport, ReferenceHub)" />.
2626
/// Adds the <see cref="Handlers.Player.FailingEscapePocketDimension" /> event.
2727
/// </summary>
2828
[EventPatch(typeof(Handlers.Player), nameof(Handlers.Player.FailingEscapePocketDimension))]
@@ -39,13 +39,16 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
3939
0,
4040
new[]
4141
{
42-
// referenceHub
42+
// pocketDimensionTeleport
4343
new CodeInstruction(OpCodes.Ldarg_0),
4444

45+
// referenceHub
46+
new CodeInstruction(OpCodes.Ldarg_1),
47+
4548
// true
4649
new(OpCodes.Ldc_I4_1),
4750

48-
// FailingEscapePocketDimensionEventArgs ev = new(ReferenceHub, bool)
51+
// FailingEscapePocketDimensionEventArgs ev = new(PocketDimensionTeleport, ReferenceHub, bool)
4952
new(OpCodes.Newobj, GetDeclaredConstructors(typeof(FailingEscapePocketDimensionEventArgs))[0]),
5053
new(OpCodes.Dup),
5154

EXILED/Exiled.Events/Patches/Events/Player/InteractingGenerator.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
5050
Label notAllowed = generator.DefineLabel();
5151
Label skip = generator.DefineLabel();
5252
Label skip2 = generator.DefineLabel();
53-
Label @break = newInstructions.FindLast(instruction => instruction.IsLdarg(0)).labels[0];
53+
Label @break = (Label)newInstructions.FindLast(instruction => instruction.opcode == OpCodes.Br_S).operand;
5454

5555
int offset = 1;
5656
int index = newInstructions.FindIndex(instruction => instruction.Calls(Method(typeof(Stopwatch), nameof(Stopwatch.Stop)))) + offset;

EXILED/Exiled.Events/Patches/Fixes/LockerFixes.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
3131
List<CodeInstruction> newInstructions = ListPool<CodeInstruction>.Pool.Get(instructions);
3232

3333
int offset = -1;
34-
int index = newInstructions.FindIndex(i => i.LoadsField(Field(typeof(LockerChamber), nameof(LockerChamber._spawnOnFirstChamberOpening)))) + offset;
34+
int index = newInstructions.FindIndex(i => i.LoadsField(Field(typeof(LockerChamber), nameof(LockerChamber.SpawnOnFirstChamberOpening)))) + offset;
3535

3636
newInstructions.InsertRange(index, new[]
3737
{
@@ -50,16 +50,16 @@ private static void Hepler(LockerChamber chamber)
5050
{
5151
chamber.Content.Clear();
5252

53-
if (!chamber._spawnOnFirstChamberOpening)
53+
if (!chamber.SpawnOnFirstChamberOpening)
5454
return;
5555

56-
foreach (ItemPickupBase ipb in chamber._toBeSpawned)
56+
foreach (ItemPickupBase ipb in chamber.ToBeSpawned)
5757
{
5858
if (ipb != null)
5959
ItemDistributor.SpawnPickup(ipb);
6060
}
6161

62-
chamber._toBeSpawned.Clear();
62+
chamber.ToBeSpawned.Clear();
6363
}
6464
}
6565
}

0 commit comments

Comments
 (0)