]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/bot/default/bot.qc
Improve registry API by adding REGISTRY_MAX and REGISTRY_COUNT macros
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / bot / default / bot.qc
index 7b30b62dfabbd720111f6cafad9296c231ce7a66..57de9f05cefecc0376946dd8d5ec26ae0017f689 100644 (file)
@@ -350,14 +350,14 @@ void bot_custom_weapon_priority_setup()
                        tokens = tokenizebyseparator(W_NumberWeaponOrder(autocvar_bot_ai_custom_weapon_priority_##dist)," "); \
                        bot_weapons_##dist[0] = -1; \
                        c = 0; \
-                       for(i = 0; i < tokens && c < Weapons_COUNT; ++i) { \
+                       for(i = 0; i < tokens && c < REGISTRY_COUNT(Weapons); ++i) { \
                                w = stof(argv(i)); \
                                if (w >= WEP_FIRST && w <= WEP_LAST) { \
                                        bot_weapons_##dist[c] = w; \
                                        ++c; \
                                } \
                        } \
-                       if (c < Weapons_COUNT) \
+                       if (c < REGISTRY_COUNT(Weapons)) \
                                bot_weapons_##dist[c] = -1; \
                } \
        MACRO_END