Skip to content

Commit ed00ec0

Browse files
committed
Fix possible index out of range
1 parent f0631e1 commit ed00ec0

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

ModLocalizer/Dumper.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,12 @@ private void DumpNpcs()
290290

291291
var value = ins.Operand as string;
292292

293-
ins = inst[index - 1];
293+
// try find which button is here
294+
// however, not every mod follows this rule
295+
296+
ins = inst.ElementAtOrDefault(index - 1);
297+
if (ins == null)
298+
continue;
294299

295300
if (ins.OpCode.Equals(OpCodes.Ldarg_1))
296301
npc.ShopButton1 = value;

ModLocalizer/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,5 @@
1414

1515
[assembly: Guid("613f981d-c5dd-43d1-b0ff-057169a647c4")]
1616

17-
[assembly: AssemblyVersion("0.13.0.0")]
18-
[assembly: AssemblyFileVersion("0.13.0.0")]
17+
[assembly: AssemblyVersion("0.13.1.0")]
18+
[assembly: AssemblyFileVersion("0.13.1.0")]

0 commit comments

Comments
 (0)