Skip to content

Commit

Permalink
Merge pull request #30 from anatawa12/crash-when-be-close-from-a-arra…
Browse files Browse the repository at this point in the history
…ngement-markers

Crash when be close from a arrangement markers
  • Loading branch information
anatawa12 authored Apr 22, 2020
2 parents b70e543 + 2584d4e commit 66f00b6
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 0 deletions.
35 changes: 35 additions & 0 deletions patches/rtm.patch
Original file line number Diff line number Diff line change
Expand Up @@ -599,6 +599,41 @@ index 9f15efb..380b0e5 100644
L_0077:
.end method

diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/rail/util/SwitchType$SwitchSingleCross.jasm b/src/main/rtm/jp/ngt/rtm/rail/util/SwitchType$SwitchSingleCross.jasm
index d1831ec..7eeb299 100644
--- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/rail/util/SwitchType$SwitchSingleCross.jasm
+++ b/src/main/rtm/jp/ngt/rtm/rail/util/SwitchType$SwitchSingleCross.jasm
@@ -290,20 +290,30 @@ L_0089:
aload 3
iconst_2
new jp/ngt/rtm/rail/util/RailMapSwitch
dup
aload 4
aload 5
aload 6
aload 7
invokespecial jp/ngt/rtm/rail/util/RailMapSwitch/<init> (Ljp/ngt/rtm/rail/util/RailPosition;Ljp/ngt/rtm/rail/util/RailPosition;Ljp/ngt/rtm/rail/util/RailDir;Ljp/ngt/rtm/rail/util/RailDir;)V
aastore
+
+ aload 3
+ invokestatic com/anatawa12/fixRtm/UtilsKt/isAllNotNull ([Ljava/lang/Object;)Z
+ ifne L_all_railMaps_are_not_null
+ iconst_0
+ ireturn
+L_all_railMaps_are_not_null:
+ .stack use locals
+ .end stack
+
L_0096:
.line 172
aload 0
aload 3
putfield jp/ngt/rtm/rail/util/SwitchType$SwitchSingleCross/railMaps "[Ljp/ngt/rtm/rail/util/RailMapSwitch;"
L_009b:
.line 174
aload 0
iconst_4
anewarray jp/ngt/rtm/rail/util/Point
diff --git a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/sound/MovingSoundMaker.jasm b/src/main/rtm/jp/ngt/rtm/sound/MovingSoundMaker.jasm
index 34f470e..019c243 100644
--- a/mods/rtm.deobf.jar.src.processed/jp/ngt/rtm/sound/MovingSoundMaker.jasm
Expand Down
5 changes: 5 additions & 0 deletions src/main/java/com/anatawa12/fixRtm/Utils.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package com.anatawa12.fixRtm


fun <E> List<E?>.isAllNotNull(): Boolean = all { it != null }
fun <E> Array<E?>.isAllNotNull(): Boolean = all { it != null }

0 comments on commit 66f00b6

Please sign in to comment.