STHud uses the following checks to determine if a unit is currently carrying an AT or a AR/MG type weapon:
(getText(configFile >> "CfgWeapons" >> primaryWeapon(_unit) >> "UIPicture") == "\a3\weapons_f\data\ui\icon_mg_ca.paa") (getText(configFile >> "CfgWeapons" >> secondaryWeapon(_unit) >> "UIPicture") == "\a3\weapons_f\data\ui\icon_at_ca.paa")
It checks the weapons in use rather than the starting type because gear gets handed around during missions etc.
The decision to use UIPicture was based on what was the most reliable way found in A2, so if there's a better way in A3 I can switch to that (although the UI Pictures should probably be fixed anyway).
For example, the Blufor automatic rifleman unit's weapon is "arifle_MX_SW_Hamr_point_gripod_F", which is currently configured to show as "\A3\weapons_f\data\UI\icon_regular_CA.paa".
Similarly, the Opfor AT unit's launcher is "launch_RPG32_F" which has the UIPicture value of "\A3\weapons_f\data\UI\icon_regular_CA.paa" (overriding the UIPicture set in Launcher_Base_F value).