anchor.diff:  procedure TSoundLib.ExportSounds;
   var f:file; i:integer;
   begin
  -  if not IsSoundInitialized then exit;
  +  if not fIsSoundInitialized then exit;
     CreateDir(ExeDir+'Export\');
     CreateDir(ExeDir+'Export\Sounds.dat\');
  -  for i:=1 to MaxWaves do if length(Waves[i].Data)>0 then begin
  +  for i:=1 to fWavesCount do if length(fWaves[i].Data)>0 then begin
       assignfile(f,ExeDir+'Export\Sounds.dat\sound_'+int2fix(i,3)+'_'+SSoundFX[TSoundFX(i)]+'.wav'); rewrite(f,1);
       //Waves[i].Head.SampleRate := Waves[i].Head.SampleRate div 2; //Make it half speed?
  -    blockwrite(f,Waves[i].Head,SizeOf(Waves[i].Head));
  -    blockwrite(f,Waves[i].Data[0],length(Waves[i].Data));
  -    blockwrite(f,Waves[i].Foot[0],length(Waves[i].Foot));
  +    blockwrite(f,fWaves[i].Head,SizeOf(fWaves[i].Head));
  +    blockwrite(f,fWaves[i].Data[0],length(fWaves[i].Data));
  +    blockwrite(f,fWaves[i].Foot[0],length(fWaves[i].Foot));
       closefile(f);
     end;
   end;
  
positive.code:       PlaySince:cardinal;
      end;}
  
      Sound:array [1..MAX_SOUNDS] of record
        ALBuffer:TALuint;
        ALSource:TALuint;
        Name:string;
  
negative.code:   if FreeBuf = 0 then exit;//Don't play if there's no room left
  
    ID := word(SoundID);
    Assert(fWaves[ID].IsLoaded);
  
    //Stop previously playing sound and release buffer
    AlSourceStop(fSound[FreeBuf].ALSource);
    AlSourcei(fSound[FreeBuf].ALSource, AL_BUFFER, 0);
  
    //Assign new data to buffer and assign it to source
    AlBufferData(fSound[FreeBuf].ALBuffer, AL_FORMAT_MONO8, @fWaves[ID].Data[0], fWaves[ID].Head.DataSize, fWaves[ID].Head.SampleRate);
  
    //Set source properties
    AlSourcei(fSound[FreeBuf].ALSource, AL_BUFFER, fSound[FreeBuf].ALBuffer);
    AlSourcef(fSound[FreeBuf].ALSource, AL_PITCH, 1.0);
    AlSourcef(fSound[FreeBuf].ALSource, AL_GAIN, 1.0 * Volume * fSoundGain);
    if Attenuated then begin
      Dif[1]:=Loc.X; Dif[2]:=Loc.Y; Dif[3]:=0;
      AlSourcefv(fSound[FreeBuf].ALSource, AL_POSITION, @Dif[1]);
      AlSourcei(fSound[FreeBuf].ALSource, AL_SOURCE_RELATIVE, AL_FALSE); //If Attenuated then it is not relative to the listener
    end else
    begin
      //For sounds that do not change over distance, set to SOURCE_RELATIVE and make the position be 0,0,0 which means it will follow the listener
      //Do not simply set position to the listener as the listener could change while the sound is playing
      Dif[1]:=0; Dif[2]:=0; Dif[3]:=0;
      AlSourcefv(fSound[FreeBuf].ALSource, AL_POSITION, @Dif[1]);
      AlSourcei(fSound[FreeBuf].ALSource, AL_SOURCE_RELATIVE, AL_TRUE); //Relative to the listener, meaning it follows us
    end;
    AlSourcef(fSound[FreeBuf].ALSource, AL_REFERENCE_DISTANCE, 4.0);
    AlSourcef(fSound[FreeBuf].ALSource, AL_MAX_DISTANCE, MAX_DISTANCE);
    AlSourcef(fSound[FreeBuf].ALSource, AL_ROLLOFF_FACTOR, 1.0);
    AlSourcei(fSound[FreeBuf].ALSource, AL_LOOPING, AL_FALSE);
  
    //Start playing
    AlSourcePlay(fSound[FreeBuf].ALSource);
    fSound[FreeBuf].Name := SSoundFX[SoundID];
    fSound[FreeBuf].Position := Loc;
    fSound[FreeBuf].Duration := round(fWaves[ID].Head.FileSize / fWaves[ID].Head.BytesPerSecond * 1000);
    fSound[FreeBuf].PlaySince := GetTickCount;
  end;
  
  
  function TSoundLib.GetWarriorSoundFile(aUnitType:TUnitType; aSound:TSoundToPlay; aNumber:byte; aLocale:string=''):string;
  begin
    if not fIsSoundInitialized then exit;
    if (aLocale = '') and (fGame <> nil) and (fGame.fGlobalSettings <> nil) then
      aLocale := fGame.fGlobalSettings.Locale;
    if not (aUnitType in [ut_Militia .. ut_Barbarian]) then
  