Skip to content

Commit 697ca77

Browse files
authored
fix: Fall damage not working (#628)
I WAS THE CAUSE OF THE FALL DAMAGE BUG NOOOOOOOOOOOO I JUST DIDNT SEE A SINGLE brfalse_s 😭 😭 😭 😭 😭 😭 😭 😭 😭 😭
1 parent 5e83b64 commit 697ca77

File tree

1 file changed

+2
-2
lines changed
  • EXILED/Exiled.Events/Patches/Events/Player

1 file changed

+2
-2
lines changed

EXILED/Exiled.Events/Patches/Events/Player/Jumping.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
4747
// after ProcessJump, store its result
4848
newInstructions.Insert(index, new CodeInstruction(OpCodes.Stloc, jumping));
4949

50-
// offset here is 0
51-
index = newInstructions.FindIndex(instruction => instruction.opcode == OpCodes.Brfalse_S);
50+
offset = 1;
51+
index = newInstructions.FindIndex(instruction => instruction.StoresField(Field(typeof(FpcMotor), nameof(FpcMotor._maxFallSpeed)))) + offset;
5252

5353
// make br_false use stored value
5454
newInstructions.Insert(index, new CodeInstruction(OpCodes.Ldloc, jumping));

0 commit comments

Comments
 (0)