From da73cf979d8a11fbc5e905d11af06f432824d272 Mon Sep 17 00:00:00 2001 From: lambdatiger Date: Mon, 26 Aug 2024 11:31:25 -0500 Subject: [PATCH] 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 2d7a9454e3316d3aa7bdfc4f6713ae3aa4859208. * 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> --- addons/common/functions/fnc_getVehicleIcon.sqf | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/common/functions/fnc_getVehicleIcon.sqf b/addons/common/functions/fnc_getVehicleIcon.sqf index c63d54a8d8..a18765567c 100644 --- a/addons/common/functions/fnc_getVehicleIcon.sqf +++ b/addons/common/functions/fnc_getVehicleIcon.sqf @@ -35,7 +35,11 @@ if (isNil "_cachedValue") then { if (_vehicleValue != "" && {((toLowerANSI _vehicleValue) find ".paa") > -1}) then { _cachedValue = _vehicleValue; } else { - _cachedValue = DEFAULT_TEXTURE; + if (_vehicleValue != "" && {fileExists (_vehicleValue + ".paa")}) then { + _cachedValue = _vehicleValue + ".paa"; + } else { + _cachedValue = DEFAULT_TEXTURE; + }; }; } else { _cachedValue = _vehicleIconValue;