Skip to content

Commit 9cb204f

Browse files
committed
Requested Changed by Yamato when reviewing the Changelog
1 parent f3c32c1 commit 9cb204f

4 files changed

Lines changed: 12 additions & 24 deletions

File tree

EXILED/Exiled.API/Extensions/MirrorExtensions.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -171,25 +171,24 @@ public static ReadOnlyDictionary<string, string> RpcFullNames
171171
/// <param name="itemType">Weapon' sound to play.</param>
172172
/// <param name="volume">Sound's volume to set.</param>
173173
/// <param name="audioClipId">GunAudioMessage's audioClipId to set (default = 0).</param>
174-
[Obsolete("This method is not working. Use PlayGunSound(Player, Vector3, ItemType, float, int, bool) overload instead.")]
174+
[Obsolete("This method is not working. Use PlayGunSound(Player, Vector3, FirearmType, float, int, bool) overload instead.")]
175175
public static void PlayGunSound(this Player player, Vector3 position, ItemType itemType, byte volume, byte audioClipId = 0)
176-
{
177-
}
176+
=> PlayGunSound(player, position, itemType.GetFirearmType(), volume, audioClipId);
178177

179178
/// <summary>
180179
/// Plays a gun sound that only the <paramref name="player"/> can hear.
181180
/// </summary>
182181
/// <param name="player">Target to play.</param>
183182
/// <param name="position">Position to play on.</param>
184-
/// <param name="itemType">Weapon's sound to play.</param>
183+
/// <param name="firearmType">Weapon's sound to play.</param>
185184
/// <param name="pitch">Speed of sound.</param>
186185
/// <param name="clipIndex">Index of clip.</param>
187-
public static void PlayGunSound(this Player player, Vector3 position, FirearmType itemType, float pitch = 1, int clipIndex = 0)
186+
public static void PlayGunSound(this Player player, Vector3 position, FirearmType firearmType, float pitch = 1, int clipIndex = 0)
188187
{
189-
if (itemType is FirearmType.ParticleDisruptor or FirearmType.None)
188+
if (firearmType is FirearmType.ParticleDisruptor or FirearmType.None)
190189
return;
191190

192-
Features.Items.Firearm firearm = Features.Items.Firearm.ItemTypeToFirearmInstance[itemType];
191+
Features.Items.Firearm firearm = Features.Items.Firearm.ItemTypeToFirearmInstance[firearmType];
193192

194193
if (firearm == null)
195194
return;

EXILED/Exiled.API/Features/Core/UserSettings/SettingBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,11 @@ public static IEnumerable<SettingBase> Register(IEnumerable<SettingBase> setting
262262
/// <summary>
263263
/// Registers all settings from the specified collection to player.
264264
/// </summary>
265-
/// <param name="settings">A collection of settings to register.</param>
266265
/// <param name="player">A player that will receive settings.</param>
266+
/// <param name="settings">A collection of settings to register.</param>
267267
/// <returns>A <see cref="IEnumerable{T}"/> of <see cref="SettingBase"/> instances that were successfully registered.</returns>
268268
/// <remarks>This method is used to sync new settings with players.</remarks>
269-
public static IEnumerable<SettingBase> Register(IEnumerable<SettingBase> settings, Player player)
269+
public static IEnumerable<SettingBase> Register(Player player, IEnumerable<SettingBase> settings)
270270
{
271271
IEnumerable<IGrouping<HeaderSetting, SettingBase>> grouped = settings.Where(s => s != null).GroupBy(s => s.Header);
272272

@@ -319,7 +319,7 @@ public static IEnumerable<SettingBase> Unregister(Func<Player, bool> predicate =
319319
/// <param name="player">Determines which player will receive this update.</param>
320320
/// <param name="settings">Settings to remove. If <c>null</c>, all settings will be removed.</param>
321321
/// <returns>A <see cref="IEnumerable{T}"/> of <see cref="SettingBase"/> instances that were successfully removed.</returns>
322-
/// <remarks>This method is used to unsync settings from players. Using it with <see cref="Register(IEnumerable{SettingBase},Player)"/> provides an opportunity to update synced settings.</remarks>
322+
/// <remarks>This method is used to unsync settings from players. Using it with <see cref="Register(Player,IEnumerable{SettingBase})"/> provides an opportunity to update synced settings.</remarks>
323323
public static IEnumerable<SettingBase> Unregister(Player player, IEnumerable<SettingBase> settings = null)
324324
{
325325
List<ServerSpecificSettingBase> list = ListPool<ServerSpecificSettingBase>.Pool.Get(ServerSpecificSettingsSync.DefinedSettings);

EXILED/Exiled.API/Features/Map.cs

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -382,19 +382,9 @@ public static void ExplodeEffect(Vector3 position, ProjectileType projectileType
382382
/// <param name="firearmType">The type of firearm to play the sound of.</param>
383383
/// <param name="maxDistance">The maximum distance the sound can be heard from.</param>
384384
/// <param name="audioClipId">The audio clip ID to play.</param>
385+
[Obsolete("This method is not working. Use PlayGunSound(Player, Vector3, FirearmType, float, int, bool) overload instead.")]
385386
public static void PlayGunSound(Vector3 position, ItemType firearmType, byte maxDistance = 45, byte audioClipId = 0)
386387
{
387-
// TODO: Not finish
388-
/*
389-
GunAudioMessage msg = new()
390-
{
391-
Weapon = firearmType,
392-
AudioClipId = audioClipId,
393-
MaxDistance = maxDistance,
394-
ShooterHub = ReferenceHub._hostHub,
395-
ShooterPosition = new RelativePosition(position),
396-
};
397-
msg.SendToAuthenticated();*/
398388
}
399389

400390
/// <summary>

EXILED/Exiled.API/Features/Player.cs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3535,10 +3535,9 @@ public void Reconnect(ushort newPort = 0, float delay = 5, bool reconnect = true
35353535
}
35363536

35373537
/// <inheritdoc cref="MirrorExtensions.PlayGunSound(Player, Vector3, ItemType, byte, byte)"/>
3538-
[Obsolete("Use PlayGunSound(Player, Vector3, ItemType, byte, byte) instead.")]
3538+
[Obsolete("Use PlayGunSound(Player, Vector3, FirearmType, byte, byte) instead.")]
35393539
public void PlayGunSound(ItemType type, byte volume, byte audioClipId = 0)
3540-
{
3541-
}
3540+
=> PlayGunSound(type.GetFirearmType(), volume, audioClipId);
35423541

35433542
/// <inheritdoc cref="MirrorExtensions.PlayGunSound(Player, Vector3, FirearmType, float, int)"/>
35443543
public void PlayGunSound(FirearmType itemType, float pitch = 1, int clipIndex = 0) =>

0 commit comments

Comments
 (0)