I've seen two tiny issues since using v1.1 on our Sunday sessions.
First is from a pre-release version:
SectFile load failed: null
java.io.FileNotFoundException
at com.maddox.rts.SFSInputStream.<init>(SFSInputStream.java:47)
at com.maddox.rts.SFSReader.<init>(SFSReader.java:19)
at com.maddox.rts.SectFile.loadFile(SectFile.java:151)
at com.maddox.rts.SectFile.loadFile(SectFile.java:132)
at com.maddox.rts.SectFile.<init>(SectFile.java:80)
at com.maddox.rts.SectFile.<init>(SectFile.java:34)
at com.maddox.il2.objects.sounds.SndAircraft.sfxInit(SndAircraft.java:43)
at com.maddox.il2.objects.air.Aircraft.setFM(Aircraft.java:1610)
at com.maddox.il2.objects.air.Aircraft.setFM(Aircraft.java:1578)
at com.maddox.il2.objects.air.NetAircraft$SPAWN._actorSpawn(NetAircraft.java:344)
at com.maddox.il2.objects.air.NetAircraft$SPAWN.actorSpawn(NetAircraft.java:584)
at com.maddox.il2.engine.cmd.CmdActorSpawn.exec(CmdActorSpawn.java:186)
at com.maddox.rts.CmdEnv.exec(CmdEnv.java:601)
at com.maddox.il2.gui.ZutiSupportMethods_GUI.spawn_ClientGUI(ZutiSupportMethods_GUI.java:1730)
at com.maddox.il2.net.ZutiSupportMethods_NetReceive.processReceivedMessage(ZutiSupportMethods_NetReceive.java:462)
at com.maddox.il2.net.NetUser.netInput(NetUser.java:1133)
at com.maddox.rts.NetObj.msgNet(NetObj.java:375)
at com.maddox.rts.MsgNet.invokeListener(MsgNet.java:56)
at com.maddox.rts.Message._send(Message.java:1217)
at com.maddox.rts.Message.sendToObject(Message.java:1191)
at com.maddox.rts.Message.sendTo(Message.java:1134)
at com.maddox.rts.Message.trySend(Message.java:1115)
at com.maddox.rts.Time.loopMessages(Time.java:305)
at com.maddox.rts.RTSConf.loopMsgs(RTSConf.java:18)
at com.maddox.il2.game.MainWin3D.loopApp(MainWin3D.java:137)
at com.maddox.il2.game.Main.exec(Main.java:445)
at com.maddox.il2.game.GameWin3D.main(GameWin3D.java:235)
The corresponding code section is here (last line is the one that throws the exception):
public void sfxInit(int gearFlapSystemType)
{
if(sndRoot == null || !(FM instanceof RealFlightModel))
return;
final SectFile sectfile = new SectFile("presets/sounds/aircraft.misc.prs");
It's a bit of a mystery as I would not expect "presets/sounds/aircraft.misc.prs" to be absent, but as this happens in aircraft spawn code, in order to avoid further side effects (bouncing planes on ground crash etc) I'd recommend to cover this code in a try-catch-block.
Second is this one:
java.lang.NullPointerException
at com.maddox.il2.engine.GunGeneric$SoundTimeoutThread.run(GunGeneric.java:141)
Corresponding code block (second-last line triggers the exception):
private final class SoundTimeoutThread extends Thread
{
public void run()
{
try { sleep(NGSE.gunSoundStopDelayMillis); }
catch(Throwable t)
{
soundTimeoutThread = new SoundTimeoutThread();
return;
}
sound.setVolume(0.0F);
sound.cancel();
Reason here seems to be that this background thread ("SoundTimeoutThread") sleeps for an arbitrary amount of time, during which the "sound" field might have been nullified.
You need to put these two "sound.(...)" lines into a block with a null-check on the "sound" field: "if (sound != null) { (...)".
Mike