Search the Community
Showing results for tags 'smaller'.
Found 1 result
-
How can I simplify these three functions without losing their purpose? I get itchy hands when I find myself coding like this, without how to improve my time coding yet. If you'll suggest a functions merge, I will appreciate it if you also explain how should I call it. I have not enough experience with params yet (studying in progress...) THY_fnc_VO_checkPlayerVehRepair = { params ["_eachVeh"]; (alive _eachVeh) AND (speed _eachVeh < 2 AND speed _eachVeh > -2) AND (!underwater _eachVeh) AND ((getPos _eachVeh) select 2 < 0.1) AND (_serviceInProgress == false) AND (!isEngineOn _eachVeh) AND (damage _eachVeh > VO_minRepairService) }; THY_fnc_VO_checkPlayerVehRefuel = { params ["_eachVeh"]; (alive _eachVeh) AND (speed _eachVeh < 2 AND speed _eachVeh > -2) AND (!underwater _eachVeh) AND ((getPos _eachVeh) select 2 < 0.1) AND (_serviceInProgress == false) AND (!isEngineOn _eachVeh) AND (fuel _eachVeh > VO_minRefuelService) }; THY_fnc_VO_checkPlayerVehRearm = { params ["_eachVeh"]; (alive _eachVeh) AND (speed _eachVeh < 2 AND speed _eachVeh > -2) AND (!underwater _eachVeh) AND ((getPos _eachVeh) select 2 < 0.1) AND (_serviceInProgress == false) AND (({getNumber (configFile >> "CfgMagazines" >> _x select 0 >> "count") != _x select 1} count (magazinesAmmo _eachVeh)) > 0) };