There are six badge slots, four of them occupied. Supply a fallback limit that will leave an existing BADGE_LIMIT alone.
BADGE_LIMIT default of 6; retain const int occupied = 4; print Open slots: 2.Keep the directives above main; occupied remains a typed local const int.
Put #ifndef, #define, #endif before main.