Simplified the colour check.

This commit is contained in:
voiper 2015-08-24 15:42:12 -07:00
parent 9de7953345
commit 54f1a87222

View File

@ -23,15 +23,8 @@ if (!isNull _light) then {deleteVehicle _light};
if (_flashlight != "") then {
_colour = getText (configFile >> "CfgWeapons" >> _flashlight >> "ItemInfo" >> "FlashLight" >> "ACE_Flashlight_Colour");
_class = switch (toLower _colour) do {
case "white": {"ACE_FlashlightProxy_White"};
case "red": {"ACE_FlashlightProxy_Red"};
case "green": {"ACE_FlashlightProxy_Green"};
case "blue": {"ACE_FlashlightProxy_Blue"};
case "yellow": {"ACE_FlashlightProxy_Yellow"};
default {"ACE_FlashlightProxy_White"};
};
if !(_colour in ["white", "red", "green", "blue", "yellow"]) then {_colour = "white"};
_class = format["ACE_FlashlightProxy_%1", _colour];
_light = _class createVehicle [0,0,0];
_light attachTo [ACE_player, [0,0.5,-0.1], "head"];