34 {
35 Switchable_Base light;
36 Mich2001Helmet helmet;
37 helmet = Mich2001Helmet.Cast(target.GetObject());
38 if ( !helmet )
39 return false;
40 light = Switchable_Base.Cast(helmet.FindAttachmentBySlotName("helmetFlashlight"));
41 if ( !light )
42 return false;
43
44 if ( light.HasEnergyManager() && light.GetCompEM().CanSwitchOn() && light.GetCompEM().CanWork() )
45 {
46 return true;
47 }
48
49 return false;
50 }