MaKiPL / OpenVIII-monogame

Open source Final Fantasy VIII engine implementation in C# working on Windows and Linux (Android and iOS planned too!) [Monogame]
MIT License
637 stars 58 forks source link

Battledat: crash with Edna in party. #138

Closed Sebanisu closed 4 years ago

Sebanisu commented 4 years ago

I'll see if I can fix it. Path is null because it's looking for d7w. Edna has no weapon file so it doesn't work.

System.InvalidOperationException
  HResult=0x80131509
  Message=Sequence contains no elements
  Source=System.Core
  StackTrace:
   at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
   at OpenVIII.Debug_battleDat..ctor(Int32 fileId, EntityType entityType, Int32 additionalFileId, Debug_battleDat skeletonReference) in K:\OpenVIII\Core\Battle\debug_battleDat.cs:line 644
   at OpenVIII.Module_battle_debug.ReadCharacterData(Int32 characterId, Int32 alternativeCostumeId, Int32 weaponId) in K:\OpenVIII\Core\Battle\module_battle_Debug.cs:line 1108
   at OpenVIII.Module_battle_debug.ReadCharacters() in K:\OpenVIII\Core\Battle\module_battle_Debug.cs:line 1063
   at OpenVIII.Module_battle_debug.ReadData() in K:\OpenVIII\Core\Battle\module_battle_Debug.cs:line 940
   at OpenVIII.Module_battle_debug.Update() in K:\OpenVIII\Core\Battle\module_battle_Debug.cs:line 243
   at OpenVIII.ModuleHandler.<Update>d__2.MoveNext() in K:\OpenVIII\Core\ModuleHandler.cs:line 65
Sebanisu commented 4 years ago

I'll try changing: if (string.IsNullOrWhiteSpace(path)) to if (string.IsNullOrWhiteSpace(path)&&test.Count()>0)

So that lets it get to bottom where it tries to load a null path. So will add an if to make it not load anything at that spot.

Since buffer is now null will need to exit the function at that point.

Sebanisu commented 4 years ago

fixed