[BUG] Crash during start when ./data/music/ has no music - Fixed

Started by Simon, May 22, 2023, 09:10:24 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Simon

Test Release 3 - 20/01/2022, Linux version
  • Download and extract the Linux release to new directory.
  • $ chmod +x L2Player
  • Copy an entire L2 directory over the same directory, so that L2Player and L2.EXE now sit in the same directory.
  • Run L2Player. It extracts many files, then crashes with log below.
  • Look at ./data/music/: This directory contains only one file, Readme.txt.
Log:
[...]
PCMA: Load ./data/cache/sound/sound_77.pcma
PCMA: Load ./data/cache/sound/sound_78.pcma
PCMA: Load ./data/cache/sound/sound_79.pcma
Cached 80 sound(s)
SpriteSheet: Calculated 102 font widths for ./data/cache/font_0.spt
SpriteSheet: Calculated 59 font widths for ./data/cache/panel_2.spt
SpriteSheet: Calculated 102 font widths for ./data/cache/font_0.spt
SpriteSheet: Calculated 102 font widths for ./data/cache/font_0.spt
Starting OpenAL... 1.1 ALSOFT 1.23.0, OpenAL Community, OpenAL Soft
AudioStream: Unable to find file ./data/music/title.mod
PlayStream: Error - Object reference not set to an instance of an object.
Unhandled exception. System.NullReferenceException: Object reference not set to an instance of an object.
   at SharpMik.Player.ModDriver.MikMod_Exit_internal() in C:\Dev\Retro\Lemmings2\SharpMik\SharpMikCore\Player\ModDriver.cs:line 535
   at SharpMik.Player.ModDriver.MikMod_Exit() in C:\Dev\Retro\Lemmings2\SharpMik\SharpMikCore\Player\ModDriver.cs:line 549
   at L2Player.AudioStreamMOD.CloseStream() in C:\Dev\Retro\Lemmings2\L2Player\L2Player\Audio\AudioStreamMOD.cs:line 73
   at L2Player.AudioPlaybackEngine.PlayStream(String fileName) in C:\Dev\Retro\Lemmings2\L2Player\L2Player\Audio\AudioPlaybackEngine.cs:line 118
   at L2Player.Game..ctor() in C:\Dev\Retro\Lemmings2\L2Player\L2Player\Game.cs:line 84
   at L2Player.Program.Main(String[] args) in C:\Dev\Retro\Lemmings2\L2Player\L2Player\Program.cs:line 91
Aborted (core dumped)


Expected instead: If I have no music, I can still play without music.

./data/music/Readme.txt says: "If you don't like the midi versions of the music, you can place .mod or .it (Amiga Tracker) versions here [...]" This sounds as if you want to ship midi music with your release. Do you want to ship midis?

-- Simon

RavenNine

Definitely a bug that one... It is supposed to start if no music files are available.

I don't plan to ship any midis, but they are default music flavour for the DOS version of Lemmings 2. I added the option to use the Amiga music files as they are considerably better to listen to :)

At this stage I haven't quite figured out the music format for the DOS version either.

RavenNine