mirror of
https://gitgud.io/c0ffeeeeeeee/rimworld-animations.git
synced 2024-08-15 00:43:45 +00:00
Changed from rerouting the job to another for joininbed to simply patching joininbed, code tidying
This commit is contained in:
parent
8177b95bc8
commit
702964a8c2
24 changed files with 143 additions and 774 deletions
|
@ -0,0 +1,40 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using HarmonyLib;
|
||||
using RimWorld;
|
||||
using Verse;
|
||||
using rjw;
|
||||
using System.Reflection.Emit;
|
||||
|
||||
namespace Rimworld_Animations
|
||||
{
|
||||
|
||||
[HarmonyPatch(typeof(JobDriver_SexBaseRecieverLoved), "MakeSexToil")]
|
||||
public static class HarmonyPatch_JobDriver_SexBaseReceiverLoved
|
||||
{
|
||||
|
||||
public static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> codeInstructions)
|
||||
{
|
||||
|
||||
var ins = codeInstructions.ToList();
|
||||
for(int i = 0; i < ins.Count; i++)
|
||||
{
|
||||
if(i + 13 < ins.Count && ins[i + 13].opcode == OpCodes.Call && ins[i + 13].OperandIs(AccessTools.DeclaredMethod(typeof(Toils_LayDown), "LayDown"))) {
|
||||
|
||||
ins.RemoveRange(i, 14);
|
||||
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
yield return ins[i];
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue