// cache the panel order into the panel_order array
if(autocvar__hud_panelorder != hud_panelorder_prev) {
- for(i = 0; i < hud_panels_COUNT; ++i)
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
panel_order[i] = -1;
string s = "";
int p_num;
bool warning = false;
int argc = tokenize_console(autocvar__hud_panelorder);
- if (argc > hud_panels_COUNT)
+ if (argc > REGISTRY_COUNT(hud_panels))
warning = true;
//first detect wrong/missing panel numbers
- for(i = 0; i < hud_panels_COUNT; ++i) {
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
p_num = stoi(argv(i));
- if (p_num >= 0 && p_num < hud_panels_COUNT) { //correct panel number?
+ if (p_num >= 0 && p_num < REGISTRY_COUNT(hud_panels)) { //correct panel number?
if (panel_order[p_num] == -1) //found for the first time?
s = strcat(s, ftos(p_num), " ");
panel_order[p_num] = 1; //mark as found
else
warning = true;
}
- for(i = 0; i < hud_panels_COUNT; ++i) {
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
if (panel_order[i] == -1) {
warning = true;
s = strcat(s, ftos(i), " "); //add missing panel number
//now properly set panel_order
tokenize_console(s);
- for(i = 0; i < hud_panels_COUNT; ++i) {
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
panel_order[i] = stof(argv(i));
}
}
hud_draw_maximized = 0;
// draw panels in the order specified by panel_order array
- for(i = hud_panels_COUNT - 1; i >= 0; --i)
+ for(i = REGISTRY_COUNT(hud_panels) - 1; i >= 0; --i)
HUD_Panel_Draw(hud_panels_from(panel_order[i]));
HUD_Vehicle();
); \
MACRO_END
-int panel_order[hud_panels_MAX];
+int panel_order[REGISTRY_MAX(hud_panels)];
string hud_panelorder_prev;
bool hud_draw_maximized;
const float BORDER_MULTIPLIER = 4;
float scoreboard_bottom;
-int weapon_accuracy[Weapons_MAX];
+int weapon_accuracy[REGISTRY_MAX(Weapons)];
entity complain_weapon;
int complain_weapon_type;
HUD_Write("\n");
// common cvars for all panels
- for (int i = 0; i < hud_panels_COUNT; ++i)
+ for (int i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
{
panel = hud_panels_from(i);
vector myCenter, targCenter;
vector myTarget = myPos;
int i;
- for (i = 0; i < hud_panels_COUNT; ++i) {
+ for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
if(panel == highlightedPanel) continue;
vector dist;
float ratio = mySize.x/mySize.y;
int i;
- for (i = 0; i < hud_panels_COUNT; ++i) {
+ for (i = 0; i < REGISTRY_COUNT(hud_panels); ++i) {
panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN)) continue;
if(panel == highlightedPanel) continue;
}
}
-entity tab_panels[hud_panels_MAX];
+entity tab_panels[REGISTRY_MAX(hud_panels)];
entity tab_panel;
vector tab_panel_pos;
float tab_backward;
void reset_tab_panels()
{
- for (int i = 0; i < hud_panels_COUNT; ++i)
+ for (int i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
tab_panels[i] = NULL;
}
float HUD_Panel_InputEvent(float bInputType, float nPrimary, float nSecondary)
k=0;
while(++k)
{
- for(i = 0; i < hud_panels_COUNT; ++i)
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
{
panel = hud_panels_from(i);
if(!(panel.panel_configflags & PANEL_CONFIG_MAIN))
int HUD_Panel_Check_Mouse_Pos(bool allow_move)
{
int i, j = 0;
- while(j < hud_panels_COUNT)
+ while(j < REGISTRY_COUNT(hud_panels))
{
i = panel_order[j];
j += 1;
int i;
int place = -1;
// find out where in the array our current id is, save into place
- for(i = 0; i < hud_panels_COUNT; ++i)
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
{
if(panel_order[i] == id)
{
}
// place last if we didn't find a place for it yet (probably new panel, or screwed up cvar)
if(place == -1)
- place = hud_panels_COUNT - 1;
+ place = REGISTRY_COUNT(hud_panels) - 1;
// move all ids up by one step in the array until "place"
for(i = place; i > 0; --i)
// let's save them into the cvar by some strcat trickery
string s = "";
- for(i = 0; i < hud_panels_COUNT; ++i)
+ for(i = 0; i < REGISTRY_COUNT(hud_panels); ++i)
{
s = strcat(s, ftos(panel_order[i]), " ");
}
{
int i, j = 0;
- while(j < hud_panels_COUNT)
+ while(j < REGISTRY_COUNT(hud_panels))
{
i = panel_order[j];
j += 1;
if(!hud_configure_prev)
{
hudShiftState = 0;
- for(i = hud_panels_COUNT - 1; i >= 0; --i)
+ for(i = REGISTRY_COUNT(hud_panels) - 1; i >= 0; --i)
hud_panels_from(panel_order[i]).update_time = time;
}
}
});
- int weapon_cnt = (Weapons_COUNT - 1) - disownedcnt - nHidden;
+ int weapon_cnt = (REGISTRY_COUNT(Weapons) - 1) - disownedcnt - nHidden;
if (weapon_cnt <= 0) return pos;
int rows = 1;
- if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((Weapons_COUNT - nHidden - 1) * 0.5))
+ if (autocvar_hud_panel_scoreboard_accuracy_doublerows && weapon_cnt >= floor((REGISTRY_COUNT(Weapons) - nHidden - 1) * 0.5))
rows = 2;
int columnns = ceil(weapon_cnt / rows);
HUD_Write_Cvar("hud_panel_weapons_selection_speed");
}
-entity weaponorder[Weapons_MAX];
+entity weaponorder[REGISTRY_MAX(Weapons)];
void weaponorder_swap(int i, int j, entity pass)
{
TC(int, i); TC(int, j);
if (weapons_stat & WepSet_FromWeapon(it)) continue; \
if (it.spawnflags & (WEP_FLAG_HIDDEN | WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)) nHidden += 1; \
}); \
- vector table_size = HUD_GetTableSize_BestItemAR((Weapons_COUNT - 1) - nHidden, panel_size, aspect); \
+ vector table_size = HUD_GetTableSize_BestItemAR((REGISTRY_COUNT(Weapons) - 1) - nHidden, panel_size, aspect); \
columns = table_size.x; \
rows = table_size.y; \
weapon_size.x = panel_size.x / columns; \
int weapon_cnt = 0;
FOREACH(Weapons, it != WEP_Null && it.impulse >= 0, weaponorder[weapon_cnt++] = it);
- for(i = weapon_cnt; i < Weapons_MAX; ++i)
+ for(i = weapon_cnt; i < REGISTRY_MAX(Weapons); ++i)
weaponorder[i] = NULL;
heapsort(weapon_cnt, weaponorder_swap, weaponorder_cmp, NULL);
if (it.spawnflags & WEP_FLAG_MUTATORBLOCKED) nHidden += 1;
});
weapons_stat = '0 0 0';
- float countw = 1 + floor((floor(time * cvar("wep_add"))) % ((Weapons_COUNT - 1) - nHidden));
- for(i = 0, j = 0; i <= (Weapons_COUNT - 1) && j < countw; ++i)
+ float countw = 1 + floor((floor(time * cvar("wep_add"))) % ((REGISTRY_COUNT(Weapons) - 1) - nHidden));
+ for(i = 0, j = 0; i <= (REGISTRY_COUNT(Weapons) - 1) && j < countw; ++i)
{
if(weaponorder[i].spawnflags & WEP_FLAG_MUTATORBLOCKED)
continue;
panel_pos.y += (old_panel_size.y - panel_size.y) / 2;
}
else
- weapon_count = (Weapons_COUNT - 1);
+ weapon_count = (REGISTRY_COUNT(Weapons) - 1);
// animation for fading in/out the panel respectively when not in use
if(!autocvar__hud_configure)
{
slot.x = bound(0, (random() * vid_conwidth + 1), vid_conwidth);
slot.y = 1; // start it off 0 so we can use it
- slot.z = floor(random() * Weapons_MAX);
+ slot.z = floor(random() * REGISTRY_MAX(Weapons));
sc_spawntime = time + bound(0.4, random(), 0.75); // prevent spawning another one for this amount of time!
vector newcolor = randomvec() * 2;
newcolor.x = bound(0.4, newcolor.x, 1);
#ifdef CSQC
NET_HANDLE(net_effect, bool isNew)
{
- int net_name = (Effects_COUNT >= 255) ? ReadShort() : ReadByte();
+ int net_name = (REGISTRY_COUNT(Effects) >= 255) ? ReadShort() : ReadByte();
entity eff = Effects_from(net_name);
int channel = MSG_ONE;
msg_entity = client;
WriteHeader(channel, net_effect);
- (Effects_COUNT >= 255)
+ (REGISTRY_COUNT(Effects) >= 255)
? WriteShort(channel, this.m_id)
: WriteByte(channel, this.m_id);
WriteVector(channel, this.eent_net_location);
#ifdef GAMEQC
CLASS(Inventory, Object)
/** Stores counts of items, the id being the index */
- ATTRIBARRAY(Inventory, inv_items, int, Items_MAX);
+ ATTRIBARRAY(Inventory, inv_items, int, REGISTRY_MAX(Items));
/** Previous state */
ATTRIB(Inventory, inventory, Inventory);
ENDCLASS(Inventory)
REGISTER_NET_LINKED(ENT_CLIENT_INVENTORY)
const int Inventory_groups_minor = 8; // exactly 1 byte
-const int Inventory_groups_major = 3; // ceil(Items_MAX / Inventory_groups_minor)
+const int Inventory_groups_major = 3; // ceil(REGISTRY_MAX(Items) / Inventory_groups_minor)
#define G_MAJOR(id) (floor((id) / Inventory_groups_minor))
#define G_MINOR(id) ((id) % Inventory_groups_minor)
REGISTER_REGISTRY(Monsters)
REGISTRY_CHECK(Monsters)
const int MON_FIRST = 1;
-#define MON_LAST (Monsters_COUNT - 1)
+#define MON_LAST (REGISTRY_COUNT(Monsters) - 1)
#define REGISTER_MONSTER(id, inst) REGISTER(Monsters, MON, id, monsterid, inst)
#include "monster.qh"
#ifdef CSQC
// reserve one more spot for superweapons time
-float ItemsTime_time[Items_MAX + 1];
-float ItemsTime_availableTime[Items_MAX + 1];
+float ItemsTime_time[REGISTRY_MAX(Items) + 1];
+float ItemsTime_availableTime[REGISTRY_MAX(Items) + 1];
NET_HANDLE(itemstime, bool isNew)
{
int i = ReadByte();
FOREACH(Items, true, {
ItemsTime_time[it.m_id] = -1;
});
- ItemsTime_time[Items_MAX] = -1;
+ ItemsTime_time[REGISTRY_MAX(Items)] = -1;
}
int autocvar_hud_panel_itemstime = 2;
#ifdef SVQC
// reserve one more spot for superweapons time
-float it_times[Items_MAX + 1];
+float it_times[REGISTRY_MAX(Items) + 1];
STATIC_INIT(ItemsTime_Init) {
FOREACH(Items, Item_ItemsTime_Allow(it), {
it_times[it.m_id] = -1;
});
- it_times[Items_MAX] = -1;
+ it_times[REGISTRY_MAX(Items)] = -1;
}
void Item_ItemsTime_ResetTimes()
FOREACH(Items, Item_ItemsTime_Allow(it), {
it_times[it.m_id] = (it_times[it.m_id] == -1) ? -1 : 0;
});
- it_times[Items_MAX] = (it_times[Items_MAX] == -1) ? -1 : 0;
+ it_times[REGISTRY_MAX(Items)] = (it_times[REGISTRY_MAX(Items)] == -1) ? -1 : 0;
}
void Item_ItemsTime_ResetTimesForPlayer(entity e)
FOREACH(Items, Item_ItemsTime_Allow(it), {
IT_Write(e, it.m_id, (it_times[it.m_id] == -1) ? -1 : 0);
});
- IT_Write(e, Items_MAX, (it_times[Items_MAX] == -1) ? -1 : 0);
+ IT_Write(e, REGISTRY_MAX(Items), (it_times[REGISTRY_MAX(Items)] == -1) ? -1 : 0);
}
void Item_ItemsTime_SetTimesForPlayer(entity e)
FOREACH(Items, Item_ItemsTime_Allow(it), {
IT_Write(e, it.m_id, it_times[it.m_id]);
});
- IT_Write(e, Items_MAX, it_times[Items_MAX]);
+ IT_Write(e, REGISTRY_MAX(Items), it_times[REGISTRY_MAX(Items)]);
}
void Item_ItemsTime_SetTime(entity e, float t)
if (!item.instanceOfWeaponPickup)
it_times[item.m_id] = t;
else if (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS)
- it_times[Items_MAX] = t;
+ it_times[REGISTRY_MAX(Items)] = t;
}
}
FOREACH(Items, Item_ItemsTime_Allow(it), {
count += (Item_ItemsTime_GetTime(it.m_id) > time || -Item_ItemsTime_GetTime(it.m_id) > time);
});
- count += (Item_ItemsTime_GetTime(Items_MAX) > time || -Item_ItemsTime_GetTime(Items_MAX) > time);
+ count += (Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) > time || -Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) > time);
}
else if (autocvar_hud_panel_itemstime_hidespawned == 2)
{
FOREACH(Items, Item_ItemsTime_Allow(it), {
count += (Item_ItemsTime_GetTime(it.m_id) > time);
});
- count += (Item_ItemsTime_GetTime(Items_MAX) > time);
+ count += (Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) > time);
}
else
{
FOREACH(Items, Item_ItemsTime_Allow(it), {
count += (Item_ItemsTime_GetTime(it.m_id) != -1);
});
- count += (Item_ItemsTime_GetTime(Items_MAX) != -1);
+ count += (Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) != -1);
}
if (count == 0)
return;
row = 0;
column = column + 1;
}
- if(id == Items_MAX) // can happen only in the last fake iteration
+ if(id == REGISTRY_MAX(Items)) // can happen only in the last fake iteration
break;
});
// add another fake iteration for superweapons time
- if(id < Items_MAX && Item_ItemsTime_GetTime(Items_MAX) != -1)
+ if(id < REGISTRY_MAX(Items) && Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) != -1)
{
- id = Items_MAX;
+ id = REGISTRY_MAX(Items);
icon = "superweapons";
goto iteration;
}
M_ARGV(0, string) = strcat(M_ARGV(0, string), ", Stale-move negation");
}
-.float x_smneg_weight[Weapons_MAX];
+.float x_smneg_weight[REGISTRY_MAX(Weapons)];
float smneg_multiplier(float weight) {
float a = autocvar_g_smneg_bonus_asymptote;
const int TUR_FIRST = 1;
-#define TUR_LAST (Turrets_COUNT - 1)
+#define TUR_LAST (REGISTRY_COUNT(Turrets) - 1)
#define REGISTER_TURRET(id, inst) REGISTER(Turrets, TUR, id, m_id, inst)
// extra information
if (TUR_CONFIG_COUNT <= MAX_CONFIG_SETTINGS - 1)
- LOG_INFOF("Totals: %d turrets, %d settings", (Turrets_COUNT - 1), totalsettings);
+ LOG_INFOF("Totals: %d turrets, %d settings", (REGISTRY_COUNT(Turrets) - 1), totalsettings);
// clear queue now that we're finished
TUR_CONFIG_COUNT = 0;
REGISTRY_CHECK(Vehicles)
const int VEH_FIRST = 1;
-#define VEH_LAST (Vehicles_COUNT - 1)
+#define VEH_LAST (REGISTRY_COUNT(Vehicles) - 1)
#define REGISTER_VEHICLE(id, inst) REGISTER(Vehicles, VEH, id, vehicleid, inst)
WepSet _WepSet_FromWeapon(int a)
{
a -= WEP_FIRST;
- if (Weapons_MAX > 24)
+ if (REGISTRY_MAX(Weapons) > 24)
if (a >= 24)
{
a -= 24;
- if (Weapons_MAX > 48)
+ if (REGISTRY_MAX(Weapons) > 48)
if (a >= 24)
{
a -= 24;
#ifdef SVQC
void WriteWepSet(float dst, WepSet w)
{
- if (Weapons_MAX > 48) WriteInt72_t(dst, w);
- else if (Weapons_MAX > 24) WriteInt48_t(dst, w);
+ if (REGISTRY_MAX(Weapons) > 48) WriteInt72_t(dst, w);
+ else if (REGISTRY_MAX(Weapons) > 24) WriteInt48_t(dst, w);
else WriteInt24_t(dst, w.x);
}
#endif
}
WepSet ReadWepSet()
{
- if (Weapons_MAX > 48) return ReadInt72_t();
- if (Weapons_MAX > 24) return ReadInt48_t();
+ if (REGISTRY_MAX(Weapons) > 48) return ReadInt72_t();
+ if (REGISTRY_MAX(Weapons) > 24) return ReadInt48_t();
return ReadInt24_t() * '1 0 0';
}
#endif
return mapPriorityList(order, W_NumberWeaponOrder_MapFunc);
}
-float W_FixWeaponOrder_BuildImpulseList_buf[Weapons_MAX];
+float W_FixWeaponOrder_BuildImpulseList_buf[REGISTRY_MAX(Weapons)];
string W_FixWeaponOrder_BuildImpulseList_order;
void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass)
{
#define WEP_CVAR_BOTH(wepname, isprimary, name) ((isprimary) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name))
const int WEP_FIRST = 1;
-#define WEP_LAST (Weapons_COUNT - 1)
+#define WEP_LAST (REGISTRY_COUNT(Weapons) - 1)
WepSet WEPSET_ALL;
WepSet WEPSET_SUPERWEAPONS;
// TODO: invert after 0.8.2. Will require moving 'best weapon' impulses
#define WEP_IMPULSE_BEGIN 230
-#define WEP_IMPULSE_END bound(WEP_IMPULSE_BEGIN, WEP_IMPULSE_BEGIN + (Weapons_COUNT - 1) - 1, 253)
+#define WEP_IMPULSE_END bound(WEP_IMPULSE_BEGIN, WEP_IMPULSE_BEGIN + (REGISTRY_COUNT(Weapons) - 1) - 1, 253)
REGISTRY_SORT(Weapons, WEP_HARDCODED_IMPULSES + 1)
REGISTRY_CHECK(Weapons)
FOREACH(Weapons, true, it.wr_init(it));
#endif
weaponorder_byid = "";
- for (int i = Weapons_MAX - 1; i >= 1; --i)
+ for (int i = REGISTRY_MAX(Weapons) - 1; i >= 1; --i)
if (Weapons_from(i))
weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i));
weaponorder_byid = strzone(substring(weaponorder_byid, 1, -1));
#define _R_DEL(r)
#endif
+#define REGISTRY_MAX(id) id##_MAX
+#define REGISTRY_COUNT(id) id##_COUNT
/**
* Declare a new registry.
*
entity a = _R_GET(_##id, i), b = _R_GET(_##id, j); \
_R_SET(_##id, i, b); \
_R_SET(_##id, j, a); \
- \
+ \
entity a_next = a.REGISTRY_NEXT, b_next = b.REGISTRY_NEXT; \
a.REGISTRY_NEXT = b_next; \
b.REGISTRY_NEXT = a_next; \
- \
+ \
if (i == 0) id##_first = b; \
else _R_GET(_##id, i - 1).REGISTRY_NEXT = b; \
- \
+ \
if (j == 0) id##_first = a; \
else _R_GET(_##id, j - 1).REGISTRY_NEXT = a; \
} \
ENDCLASS(id##Registry) \
REGISTER(Registries, REGISTRY, id, m_id, NEW(id##Registry)); \
METHOD(id##Registry, m_reload, void()) { \
- id##_state = 0; \
+ id##_state = 0; \
Register##id(); \
}
if (returns) returns(it.titleTooltip);
return it;
}
-METHOD(SettingSource, reload, int(entity this, string filter)) { return Settings_COUNT; }
+METHOD(SettingSource, reload, int(entity this, string filter)) { return REGISTRY_COUNT(Settings); }
string XonoticRegisteredSettingsList_cb_name;
string XonoticRegisteredSettingsList_cb_tooltip;
const int WPFLAGMASK_NORELINK = (WAYPOINTFLAG_TELEPORT | WAYPOINTFLAG_LADDER | WAYPOINTFLAG_JUMP | WAYPOINTFLAG_CUSTOM_JP | WAYPOINTFLAG_SUPPORT);
float bot_custom_weapon;
-float bot_weapons_close[Weapons_MAX];
-float bot_weapons_far[Weapons_MAX];
-float bot_weapons_mid[Weapons_MAX];
+float bot_weapons_close[REGISTRY_MAX(Weapons)];
+float bot_weapons_far[REGISTRY_MAX(Weapons)];
+float bot_weapons_mid[REGISTRY_MAX(Weapons)];
float skill;
.float bot_tracewalk_time;
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
// Choose weapons for far distance
if ( distance > bot_distance_far ) {
- for(i=0; i < Weapons_COUNT && bot_weapons_far[i] != -1 ; ++i){
+ for(i=0; i < REGISTRY_COUNT(Weapons) && bot_weapons_far[i] != -1 ; ++i){
w = bot_weapons_far[i];
if ( client_hasweapon(this, Weapons_from(w), weaponentity, true, false) )
{
// Choose weapons for mid distance
if ( distance > bot_distance_close) {
- for(i=0; i < Weapons_COUNT && bot_weapons_mid[i] != -1 ; ++i){
+ for(i=0; i < REGISTRY_COUNT(Weapons) && bot_weapons_mid[i] != -1 ; ++i){
w = bot_weapons_mid[i];
if ( client_hasweapon(this, Weapons_from(w), weaponentity, true, false) )
{
}
// Choose weapons for close distance
- for(i=0; i < Weapons_COUNT && bot_weapons_close[i] != -1 ; ++i){
+ for(i=0; i < REGISTRY_COUNT(Weapons) && bot_weapons_close[i] != -1 ; ++i){
w = bot_weapons_close[i];
if ( client_hasweapon(this, Weapons_from(w), weaponentity, true, false) )
{
float bot_waypoints_for_items;
-.float attack_finished_for[Weapons_MAX * MAX_WEAPONSLOTS];
+.float attack_finished_for[REGISTRY_MAX(Weapons) * MAX_WEAPONSLOTS];
.float attack_finished_single[MAX_WEAPONSLOTS];
#if INDEPENDENT_ATTACK_FINISHED
#define ATTACK_FINISHED_FOR(ent, w, slot) ((ent).(attack_finished_for[((w) - WEP_FIRST) * MAX_WEAPONSLOTS + (slot)]))
bool radar_showennemies;
-.float weapon_load[Weapons_MAX];
+.float weapon_load[REGISTRY_MAX(Weapons)];
.int ammo_none; // used by the reloading system, must always be 0
.int clip_load;
.int old_clip_load;
REPLICATE(cvar_cl_accuracy_data_receive, bool, "cl_accuracy_data_receive");
.entity accuracy;
-.float accuracy_frags[Weapons_MAX];
+.float accuracy_frags[REGISTRY_MAX(Weapons)];
-.float accuracy_hit[Weapons_MAX];
-.float accuracy_fired[Weapons_MAX];
-.float accuracy_cnt_hit[Weapons_MAX];
-.float accuracy_cnt_fired[Weapons_MAX];
+.float accuracy_hit[REGISTRY_MAX(Weapons)];
+.float accuracy_fired[REGISTRY_MAX(Weapons)];
+.float accuracy_cnt_hit[REGISTRY_MAX(Weapons)];
+.float accuracy_cnt_fired[REGISTRY_MAX(Weapons)];
// init/free