Hi guys,
I've got this piece of code in room1.asc:
function room_Load(){
interface_toggle(false);
achM = aM1.Play();
}
It's then followed up in room14.asc with this:
function room_Load(){
interface_toggle(false);
achM.Stop();
}
A user emulating in Wine is saying they get the following error:
Quoteroom14.asc, line 3
NullPointerReferenced.
So in summary, I've got a global value 'achM' set to an audio channel and I play some music in it in the first room, then for the outro I stop the music. I have no issues with this on a PC so does anyone have any ideas as to why it doesn't work in Wine or how I can possibly stop it from crashing?
Not sure from your description whether the music plays for the person emulating in Wine. But anyway, I don't think you're guaranteed to get a non-null pointer from aM1.Play(). Check for a null pointer before you stop the music:
if(achM != null)
achM.Stop();
That would be the easiest way to stop it from crashing.
Thanks Gurok, seems logical, I'll patch that in now!