Merge pull request #571 from AttorneyOnline/fix-568
Fix custom objections not playing sounds
This commit is contained in:
		
						commit
						a4b5023088
					
				@ -264,8 +264,11 @@ QString AOApplication::get_real_suffixed_path(const VPath &vpath,
 | 
				
			|||||||
  // Try cache first
 | 
					  // Try cache first
 | 
				
			||||||
  QString phys_path = asset_lookup_cache.value(qHash(vpath));
 | 
					  QString phys_path = asset_lookup_cache.value(qHash(vpath));
 | 
				
			||||||
  if (!phys_path.isEmpty() && exists(phys_path)) {
 | 
					  if (!phys_path.isEmpty() && exists(phys_path)) {
 | 
				
			||||||
 | 
					    for (const QString &suffix : suffixes) { // make sure cached asset is the right type
 | 
				
			||||||
 | 
					      if (phys_path.endsWith(suffix, Qt::CaseInsensitive))
 | 
				
			||||||
        return phys_path;
 | 
					        return phys_path;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // Cache miss; try each suffix on all known mount paths
 | 
					  // Cache miss; try each suffix on all known mount paths
 | 
				
			||||||
  QStringList bases = get_mount_paths();
 | 
					  QStringList bases = get_mount_paths();
 | 
				
			||||||
 | 
				
			|||||||
@ -506,7 +506,7 @@ QString AOApplication::get_court_sfx(QString p_identifier, QString p_misc)
 | 
				
			|||||||
QString AOApplication::get_sfx_suffix(VPath sound_to_check)
 | 
					QString AOApplication::get_sfx_suffix(VPath sound_to_check)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
  return get_real_suffixed_path(sound_to_check,
 | 
					  return get_real_suffixed_path(sound_to_check,
 | 
				
			||||||
                                { "", ".opus", ".ogg", ".mp3", ".wav" });
 | 
					                                {".opus", ".ogg", ".mp3", ".wav" });
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QString AOApplication::get_image_suffix(VPath path_to_check, bool static_image)
 | 
					QString AOApplication::get_image_suffix(VPath path_to_check, bool static_image)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
		Reference in New Issue
	
	Block a user