Common - Make FUNC(getVehicleIcon) check for strings without the .paa extension (#10257)

* added fallback for icons without .paa post-fix

* Make sure it's at least a valid path before we spend time searching

* Revert "Make sure it's at least a valid path before we spend time searching"

This reverts commit 2d7a9454e3.

* Added checking for empty `_vehicleValue` strings

Update addons/common/functions/fnc_getVehicleIcon.sqf

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>

---------

Co-authored-by: johnb432 <58661205+johnb432@users.noreply.github.com>
This commit is contained in:
lambdatiger 2024-08-26 11:31:25 -05:00 committed by GitHub
parent 18bd1acc33
commit da73cf979d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -34,9 +34,13 @@ if (isNil "_cachedValue") then {
if (_vehicleIconValue == "") then {
if (_vehicleValue != "" && {((toLowerANSI _vehicleValue) find ".paa") > -1}) then {
_cachedValue = _vehicleValue;
} else {
if (_vehicleValue != "" && {fileExists (_vehicleValue + ".paa")}) then {
_cachedValue = _vehicleValue + ".paa";
} else {
_cachedValue = DEFAULT_TEXTURE;
};
};
} else {
_cachedValue = _vehicleIconValue;
};