mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Simplified the colour check.
This commit is contained in:
parent
9de7953345
commit
54f1a87222
@ -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"];
|
||||
|
Loading…
Reference in New Issue
Block a user