Merge branch 'master' into dev

This commit is contained in:
Atony committed 2026-04-01 21:33:21 -05:00
commit d89bce6956
2 files changed
+26 -1

No files matched your search

+1 -1
View File
@@ -287,7 +287,7 @@ public static class CustomMurderRpc
source.CurrentOutfitType == PlayerOutfitType.Shapeshifted,
source.shapeshiftTargetPlayerId,
target.PlayerId);
source.MyPhysics.StartCoroutine(source.KillAnimations.Random()?.CoPerformCustomKill(source, target, createDeadBody, teleportMurderer));
source.MyPhysics.StartCoroutine(source.KillAnimations.RandomSnapshot().CoPerformCustomKill(source, target, createDeadBody, teleportMurderer));
}
/// <summary>
+25
View File
@@ -132,6 +132,31 @@ public static class Extensions
button.SetCooldownFill(num);
}
/// <summary>
/// Returns a random element from the specified sequence.
/// </summary>
/// <param name="input">
/// The sequence to select an element from.
/// </param>
/// <typeparam name="T">
/// The type of elements in the sequence.
/// </typeparam>
/// <returns>
/// A randomly selected element from <paramref name="input"/>.
/// </returns>
/// <exception cref="InvalidOperationException">
/// Thrown when <paramref name="input"/> is empty.
/// </exception>
public static T RandomSnapshot<T>(this IEnumerable<T> input)
{
var list = input.ToList();
if (list.Count == 0)
throw new InvalidOperationException("Cannot get random element from an empty collection.");
return list[UnityEngine.Random.Range(0, list.Count)];
}
/// <summary>
/// Gets a PlayerControl from their PlayerVoteArea in a meeting.
/// </summary>