Beispiel #1
0
 public static uint getNextFormID(Plugin plugin)
 {
     var tes4 = plugin.Records.OfType<Record>().FirstOrDefault(x => x.Name == "TES4");
     if (tes4 != null && tes4.SubRecords.Count > 0 && tes4.SubRecords[0].Name == "HEDR" && tes4.SubRecords[0].Size >= 8)
     {
         byte[] data = tes4.SubRecords[0].GetData();
         uint formid = (uint)TypeConverter.GetObject<uint>(data, 8);
         TypeConverter.i2h(formid + 1, data, 8);
         tes4.SubRecords[0].SetData(data);
         return formid;
     }
     throw new ApplicationException(Resources.PluginLacksAValidTes4RecordCannotContinue);
 }