Skip to content

Commit

Permalink
xd
Browse files Browse the repository at this point in the history
  • Loading branch information
IRacle1 committed Oct 12, 2024
1 parent b188280 commit 9364608
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions EXILED/Exiled.API/Extensions/MirrorExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,9 +242,7 @@ public static void SetRoomLightIntensityForTargetOnly(this Room room, Player tar
/// </summary>
/// <param name="player">Player to change.</param>
/// <param name="type">Model type.</param>
/// <param name="skipJump">Whether or not to skip the little jump that works around an invisibility issue.</param>
/// <param name="unitId">The UnitNameId to use for the player's new role, if the player's new role uses unit names. (is NTF).</param>
public static void ChangeAppearance(this Player player, RoleTypeId type, bool skipJump = false, byte unitId = 0) => ChangeAppearance(player, type, Player.List.Where(x => x != player), skipJump, unitId);
public static void ChangeAppearance(this Player player, RoleTypeId type) => ChangeAppearance(player, type, Player.List.Where(x => x != player));

/// <summary>
/// Change <see cref="Player"/> character model for appearance.
Expand All @@ -253,16 +251,14 @@ public static void SetRoomLightIntensityForTargetOnly(this Room room, Player tar
/// <param name="player">Player to change.</param>
/// <param name="type">Model type.</param>
/// <param name="playersToAffect">The players who should see the changed appearance.</param>
/// <param name="skipJump">Whether or not to skip the little jump that works around an invisibility issue.</param>
/// <param name="unitId">The UnitNameId to use for the player's new role, if the player's new role uses unit names. (is NTF).</param>
public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumerable<Player> playersToAffect, bool skipJump = false, byte unitId = 0)
public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumerable<Player> playersToAffect)
{
if (!player.IsConnected)
return;

if (!player.Role.CheckAppearanceCompatibility(type))
{
Log.Error($"[IRacle] Кринжанули братки {player.Role.Type} {type}");
Log.Error($"Prevent Seld-Desync of {player.Nickname} ({player.Role.Type}) with {type}");
return;
}

Expand All @@ -272,10 +268,6 @@ public static void ChangeAppearance(this Player player, RoleTypeId type, IEnumer
}

player.Role.UpdateAppearance();

// To counter a bug that makes the player invisible until they move after changing their appearance, we will teleport them upwards slightly to force a new position update for all clients.
if (!skipJump)
player.Position += Vector3.up * 0.25f;
}

/// <summary>
Expand Down

0 comments on commit 9364608

Please sign in to comment.