Conversation
tbeswick96
left a comment
There was a problem hiding this comment.
Code review
Found 9 issues across the HIPA faction addon.
🤖 Generated with Claude Code
- If this code review was useful, please react with 👍. Otherwise, react with 👎.
addons/hipa/config.cpp
Outdated
| units[] = { | ||
| QGVAR(Soldier_Underwear), | ||
| QGVAR(Soldier_Base), | ||
| QGVAR(Rifleman), | ||
| QGVAR(Squad_Leader), | ||
| QGVAR(Autorifleman), | ||
| QGVAR(Rifleman_LAT), | ||
| QGVAR(Sharpshooter), | ||
| QGVAR(Machine_Gunner), | ||
| QGVAR(Rifleman_HAT), | ||
| QGVAR(Armour_Crewman), | ||
| QGVAR(Officer), | ||
| QGVAR(Signaller), | ||
| QGVAR(Heli_Pilot), | ||
| QGVAR(Jet_Pilot), | ||
| QGVAR(Sniper), | ||
| QGVAR(Crewman), | ||
| QGVAR(Rifleman_AA), | ||
| QGVAR(Paratrooper), | ||
| QGVAR(Operator), | ||
| QGVAR(Grenadier), | ||
| // Vehicles | ||
| QGVAR(MTVR), | ||
| QGVAR(MTVR_Ammo), | ||
| QGVAR(MTVR_Refuel), | ||
| QGVAR(MTVR_Repair), | ||
| QGVAR(Radar_System), | ||
| QGVAR(SAM_System), | ||
| QGVAR(Ship_MRLS), | ||
| QGVAR(ZU23), | ||
| QGVAR(L134A1), | ||
| QGVAR(M252), | ||
| QGVAR(M119), | ||
| QGVAR(Dragon), | ||
| QGVAR(HMG_02), | ||
| QGVAR(RBS70), | ||
| QGVAR(HMG_01), | ||
| QGVAR(Leopard2A6), | ||
| QGVAR(T55), | ||
| QGVAR(Boxer_HMG), | ||
| QGVAR(Boxer_GMG), | ||
| QGVAR(Boxer_Empty), | ||
| QGVAR(MBT_Arty), | ||
| QGVAR(APC_AA), | ||
| QGVAR(Heli_Light_Dynamic), | ||
| QGVAR(Heli_Light), | ||
| QGVAR(AW159), | ||
| QGVAR(AW159_Unarmed), | ||
| QGVAR(CH_54_Armed), | ||
| QGVAR(CH_54_Transport), | ||
| QGVAR(CH47F), | ||
| QGVAR(JAS39), | ||
| QGVAR(C130J) |
There was a problem hiding this comment.
units[] has multiple issues:
Name mismatches -- these don't match their actual class definitions:
QGVAR(Autorifleman)(line 11) -- actual class isGVAR(sf_autorifleman)QGVAR(Operator)(line 25) -- actual class isGVAR(sf_operator)QGVAR(Grenadier)(line 26) -- actual class isGVAR(sf_grenadier)QGVAR(HMG_01)(line 42) -- actual class isGVAR(auto_hmg)
Completely undefined -- no class definition exists anywhere in this addon:
QGVAR(Armour_Crewman)(line 16)QGVAR(Jet_Pilot)(line 20)QGVAR(Paratrooper)(line 24)
Missing from units[] -- these are defined with scope = 2 but not registered:
GVAR(sf_operator),GVAR(sf_sfc),GVAR(sf_grenadier),GVAR(sf_autorifleman),GVAR(sf_LAT)GVAR(Officer_HQ)GVAR(LSV_01_unarmed_SF),GVAR(LSV_01_armed_SF)GVAR(auto_hmg),GVAR(Mini_Radar_Dish)
| weapons[] = { | ||
| QGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight), | ||
| QGVAR(CUP_arifle_G36K_RIS_AG36_ACE_optic_MRCO_2D_acc_flashlight), | ||
| QGVAR(CUP_lmg_MG3), | ||
| QGVAR(arifle_SPAR_03_blk_F_optic_AMS), | ||
| QGVAR(srifle_DMR_02_camo_F_optic_KHS_old), | ||
| QGVAR(CUP_arifle_G36C), | ||
| QGVAR(CUP_arifle_G36C_VFG_CUP_optic_HensoldtZO_low_RDS_CUP_acc_ANPEQ_15_Black), | ||
| QGVAR(CUP_glaunch_M32), | ||
| QGVAR(CUP_arifle_MG36_CUP_optic_HensoldtZO_low_RDS_CUP_acc_ANPEQ_15_Black), | ||
| QGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight_suppressed), | ||
| QGVAR(CUP_arifle_MG36_CUP_optic_HensoldtZO_low_RDS_CUP_acc_ANPEQ_15_Black_suppressed) | ||
| }; |
There was a problem hiding this comment.
weapons[] lists class names that don't exist:
No GVAR wrapper defined -- these are stock CUP/vanilla classes used bare in unit definitions, not custom weapons:
QGVAR(CUP_lmg_MG3)(line 63)QGVAR(CUP_arifle_G36C)(line 66)QGVAR(CUP_glaunch_M32)(line 68)
Wrong variant name:
QGVAR(CUP_arifle_G36C_VFG_CUP_optic_HensoldtZO_low_RDS_CUP_acc_ANPEQ_15_Black)(line 67) -- only the_suppressedvariant is definedQGVAR(CUP_arifle_MG36_CUP_optic_HensoldtZO_low_RDS_CUP_acc_ANPEQ_15_Black)(line 69) -- only the_suppressedvariant is definedQGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight_suppressed)(line 70) -- only the non-suppressed variant is defined
addons/hipa/config.cpp
Outdated
| QGVAR(CUP_arifle_MG36_CUP_optic_HensoldtZO_low_RDS_CUP_acc_ANPEQ_15_Black_suppressed) | ||
| }; | ||
| requiredVersion = REQUIRED_VERSION; | ||
| requiredAddons[] = {"uksf_common"}; |
There was a problem hiding this comment.
GVAR(T55) in CfgArmored.hpp inherits from uksf_eug_T55, but uksf_eug is not in requiredAddons[]. This dependency is needed to guarantee correct load order.
addons/hipa/config.cpp
Outdated
| #include "CfgFactionClasses.hpp" | ||
| #include "CfgGroups.hpp" | ||
| #include "CfgVehicles.hpp" | ||
| #include "CfgWeapons.hpp" | ||
| #include "CfgEditorSubcategories.hpp" |
There was a problem hiding this comment.
These #include directives should be in alphabetical order. Current order:
CfgFactionClasses -> CfgGroups -> CfgVehicles -> CfgWeapons -> CfgEditorSubcategories
Alphabetical:
CfgEditorSubcategories -> CfgFactionClasses -> CfgGroups -> CfgVehicles -> CfgWeapons
addons/hipa/CfgVehicles.hpp
Outdated
| weapons[] = {QGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight)}; | ||
| respawnWeapons[] = {QGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight)}; |
There was a problem hiding this comment.
Soldier_Base overrides weapons[] from O_Soldier_base_F but does not include "Put" and "Throw". This strips the ability to throw grenades and place inventory items from every unit that inherits without overriding weapons[] (Rifleman, Officer, Signaller, etc.).
Should be:
weapons[] = {QGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight), "Put", "Throw"};
respawnWeapons[] = {QGVAR(CUP_arifle_G36C_VFG_ACE_optic_MRCO_2D_acc_flashlight), "Put", "Throw"};Other units that override weapons[] are also missing Put/Throw: Squad_Leader, Sharpshooter, sf_autorifleman, Officer_HQ, Sniper, Crewman.
addons/hipa/units/CfgUnitsMen.hpp
Outdated
| weapons[] = {CUP_lmg_MG3}; | ||
| respawnWeapons[] = {CUP_lmg_MG3}; |
There was a problem hiding this comment.
Unquoted class name -- CUP_lmg_MG3 needs to be a quoted string "CUP_lmg_MG3". Bare identifiers in arrays will fail to resolve correctly.
Also missing "Put" and "Throw".
addons/hipa/units/CfgUnitsMenSF.hpp
Outdated
| weapons[] = {CUP_glaunch_M32}; | ||
| respawnWeapons[] = {CUP_glaunch_M32}; |
There was a problem hiding this comment.
Unquoted class name -- CUP_glaunch_M32 needs to be a quoted string "CUP_glaunch_M32". Also missing "Put" and "Throw".
| weapons[] = {CUP_arifle_G36C}; | ||
| respawnWeapons[] = {CUP_arifle_G36C}; |
There was a problem hiding this comment.
Unquoted class name -- CUP_arifle_G36C needs to be a quoted string "CUP_arifle_G36C". Also missing "Put" and "Throw".
addons/hipa/CfgGroups.hpp
Outdated
| class Armor { | ||
| name = "Armor"; | ||
| // Add armor groups | ||
| }; | ||
| // Add other categories |
There was a problem hiding this comment.
Two issues here:
-
UK English:
Armorshould beArmour(class name and displayName). CLAUDE.md requires UK English spelling. -
Placeholder TODO comments:
// Add armor groupsand// Add other categoriesindicate incomplete work. Either add the group definitions or remove the empty class and comment.
When merged this pull request will: