Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ChargingJailbird #2

Merged
merged 5 commits into from
Aug 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,27 @@ Scripts: # Add the 'Scripts' label

regarding-events: # Add the 'Events' label
- changed-files:
- any-glob-to-any-file: Exiled.Events/** # Any Modifications to events
- any-glob-to-any-file: EXILED/Exiled.Events/** # Any Modifications to events

regarding-api: # Add the 'API' label
- changed-files:
- any-glob-to-any-file: Exiled.API/** # Any modifications to the API
- any-glob-to-any-file: EXILED/Exiled.API/** # Any modifications to the API

regarding-transpiler: # Add the 'transpiler' label
- changed-files:
- any-glob-to-any-file: Exiled.Events/Patches/**/* # Any modifications to transpiler files
- any-glob-to-any-file: EXILED/Exiled.Events/Patches/**/* # Any modifications to transpiler files

CustomModules: # Add the 'CustomModules' label
- changed-files:
- any-glob-to-any-file: Exiled.CustomModules/** # Any modifications to CustomModules
- any-glob-to-any-file: EXILED/Exiled.CustomModules/** # Any modifications to CustomModules

Installer: # Add the 'Installer' label
- changed-files:
- any-glob-to-any-file: Exiled.Installer/** # Any modifications to the Installer
- any-glob-to-any-file: EXILED/Exiled.Installer/** # Any modifications to the Installer

Localization: # Add the 'Localization' label
- changed-files:
- any-glob-to-any-file: Localization/** # Any modifications to Localization
- any-glob-to-any-file: EXILED/Localization/** # Any modifications to Localization

GitHub_Actions: # Add the 'GitHub' label
- changed-files:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defaults:
working-directory: ./EXILED

env:
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-Reference/Dev.zip
EXILED_REFERENCES_URL: https://exmod-team.github.io/SL-References/Dev.zip
EXILED_REFERENCES_PATH: ${{ github.workspace }}/EXILED/References
EXILED_DLL_ARCHIVER_URL: https://github.com/ExMod-Team/EXILED-DLL-Archiver/releases/latest/download/EXILED-DLL-Archiver.exe

Expand Down
11 changes: 10 additions & 1 deletion EXILED/Exiled.Events/EventArgs/Item/ChargingJailbirdEventArgs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

namespace Exiled.Events.EventArgs.Item
{
using System;

using Exiled.API.Features;
using Exiled.API.Features.Items;
using Exiled.Events.EventArgs.Interfaces;
Expand All @@ -26,7 +28,9 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item
{
Player = Player.Get(player);
Item = Item.Get(swingItem);
#pragma warning disable CS0618
IsAllowed = isAllowed;
#pragma warning restore CS0618
}

/// <summary>
Expand All @@ -42,6 +46,11 @@ public ChargingJailbirdEventArgs(ReferenceHub player, InventorySystem.Items.Item
/// <summary>
/// Gets or sets a value indicating whether or not the Jailbird can be charged.
/// </summary>
public bool IsAllowed { get; set; }
public bool IsAllowed
{
get;
[Obsolete("This event cannot be denied as it will cause desync.")]
set;
}
}
}
5 changes: 1 addition & 4 deletions EXILED/Exiled.Events/Patches/Events/Item/JailbirdPatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,10 +88,7 @@ private static bool HandleJailbird(JailbirdItem instance, JailbirdMessageType me
ChargingJailbirdEventArgs ev = new(instance.Owner, instance);

Item.OnChargingJailbird(ev);
if (ev.IsAllowed)
return true;
instance.SendRpc(JailbirdMessageType.ChargeFailed, null);
return false;
return true;
}

default:
Expand Down
Loading