Files
CalamityModPublic/Utilities/ILEditingUtils.cs
T
2021-09-12 00:26:22 -04:00

18 lines
418 B
C#

using MonoMod.Cil;
namespace CalamityMod
{
public static partial class CalamityUtils
{
/// <summary>
/// Moves an <see cref="ILCursor"/> to the final Ret call in the method the cursor is assocated with.
/// </summary>
/// <param name="cursor">The cursor.</param>
public static ILCursor GotoFinalRet(this ILCursor cursor)
{
while (cursor.TryGotoNext(c => c.MatchRet())) { }
return cursor;
}
}
}