mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-09 06:13:36 +08:00
minor fix
This commit is contained in:
@@ -446,20 +446,16 @@ public class FactoryPatch : PatchImpl<FactoryPatch>
|
|||||||
new CodeMatch(OpCodes.Ldloca_S),
|
new CodeMatch(OpCodes.Ldloca_S),
|
||||||
new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(Vector3), nameof(Vector3.magnitude)))
|
new CodeMatch(OpCodes.Call, AccessTools.PropertyGetter(typeof(Vector3), nameof(Vector3.magnitude)))
|
||||||
);
|
);
|
||||||
var ldlocOpr = matcher.InstructionAt(0).operand;
|
/* Change to:
|
||||||
var jumpPos = matcher.InstructionAt(3).operand;
|
|
||||||
/* Insert after btrue:
|
|
||||||
* Ldloc.s V_8 (8)
|
* Ldloc.s V_8 (8)
|
||||||
* ldfld class PrefabDesc BuildPreview::desc
|
* ldfld class PrefabDesc BuildPreview::desc
|
||||||
* ldfld bool PrefabDesc::isPowerGen
|
* ldfld bool PrefabDesc::isEjector
|
||||||
* brtrue 2358 (1C12) ldloc.s V_8 (8)
|
* brfalse 2358 (1C12) ldloc.s V_8 (8)
|
||||||
*/
|
*/
|
||||||
matcher.Advance(4).InsertAndAdvance(
|
matcher.Advance(2);
|
||||||
new CodeInstruction(OpCodes.Ldloc_S, ldlocOpr),
|
matcher.Operand = AccessTools.Field(typeof(PrefabDesc), nameof(PrefabDesc.isEjector));
|
||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(BuildPreview), nameof(BuildPreview.desc))),
|
matcher.Advance(1);
|
||||||
new CodeInstruction(OpCodes.Ldfld, AccessTools.Field(typeof(PrefabDesc), nameof(PrefabDesc.isPowerGen))),
|
matcher.Opcode = OpCodes.Brfalse;
|
||||||
new CodeInstruction(OpCodes.Brtrue_S, jumpPos)
|
|
||||||
);
|
|
||||||
return matcher.InstructionEnumeration();
|
return matcher.InstructionEnumeration();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user