mirror of
https://github.com/kwsch/pkNX.git
synced 2026-08-27 12:54:17 -05:00
Fix Trainer/Item Info dumps
Game Freak left in DLC 2 item data, so we should only iterate on items with names present.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
using Newtonsoft.Json;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace pkNX.Structures
|
||||
|
||||
@@ -42,7 +42,7 @@ public static string GetNamedTypeTable<T>(IList<T> arr, IList<string> names, str
|
||||
list[0] = $"Index{sep}{name ?? t.Name}{sep}{list[0]}";
|
||||
|
||||
// slap in row name to row
|
||||
for (int i = 1; i < list.Length; i++)
|
||||
for (int i = 1; i < names.Count + 1; i++)
|
||||
list[i] = $"{i - 1}{sep}{names[i - 1]}{sep}{list[i]}";
|
||||
|
||||
return string.Join(Environment.NewLine, list);
|
||||
|
||||
@@ -179,8 +179,8 @@ public void DumpTrainers()
|
||||
var t = tr[i];
|
||||
|
||||
// some battles with Avery and Klara have out of bounds trclasses -- set back to "Pokémon Trainer"
|
||||
if (t.Self.Class == 250 || t.Self.Class == 251)
|
||||
t.Self.Class = 219;
|
||||
if (t.Self.Class > trc.Length)
|
||||
t.Self.Class = 1;
|
||||
|
||||
result.Add($"{i:000} - {trc[t.Self.Class]}: {trn[i]}");
|
||||
const int MoneyScalar = 80;
|
||||
|
||||
@@ -478,6 +478,9 @@ private string GetTrainerString(VsTrainer Trainer)
|
||||
var name = Trainer.Name;
|
||||
var team = Trainer.Team;
|
||||
var sb = new StringBuilder();
|
||||
if (tr.Class > trClass.Length) // Klara and Avery out of bounds trclass edge case
|
||||
tr.Class = 1;
|
||||
|
||||
sb.AppendLine("======");
|
||||
sb.Append(file).Append(" - ").Append(trClass[tr.Class]).Append(" ").AppendLine(name);
|
||||
sb.AppendLine("======");
|
||||
|
||||
Reference in New Issue
Block a user