#endif
#ifdef CSQC
-void Item_ItemsTime_Init()
-{
- FOREACH(Items, true, {
- ItemsTime_time[it.m_id] = -1;
- });
- ItemsTime_time[Items_MAX] = -1;
-}
STATIC_INIT(ItemsTime_Init) {
- Item_ItemsTime_Init();
+ FOREACH(Items, true, {
+ ItemsTime_time[it.m_id] = -1;
+ });
+ ItemsTime_time[Items_MAX] = -1;
}
int autocvar_hud_panel_itemstime = 2;
// reserve one more spot for superweapons time
float it_times[Items_MAX + 1];
-void Item_ItemsTime_Init()
-{
- FOREACH(Items, Item_ItemsTime_Allow(it), {
- it_times[it.m_id] = -1;
- });
- it_times[Items_MAX] = -1;
-}
-
STATIC_INIT(ItemsTime_Init) {
- // items time
- Item_ItemsTime_Init();
+ FOREACH(Items, Item_ItemsTime_Allow(it), {
+ it_times[it.m_id] = -1;
+ });
+ it_times[Items_MAX] = -1;
}
void Item_ItemsTime_ResetTimes()
{
if (!item.instanceOfWeaponPickup)
it_times[item.m_id] = t;
- else if (e.weapons & WEPSET_SUPERWEAPONS)
+ else if (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS)
it_times[Items_MAX] = t;
}
}
bool isavailable = (t == 0);
IL_EACH(g_items, it != e,
{
- if(!(it.itemdef == e.itemdef || ((e.weapons & WEPSET_SUPERWEAPONS) && (it.weapons & WEPSET_SUPERWEAPONS))))
+ if(!(it.itemdef == e.itemdef || ((STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS) && (STAT(WEAPONS, it) & WEPSET_SUPERWEAPONS))))
continue;
if (it.scheduledrespawntime <= time)
isavailable = true;
if (autocvar_hud_panel_itemstime_hidespawned == 2)
picalpha = 1;
else if (item_available)
- {
- float BLINK_FACTOR = 0.15;
- float BLINK_BASE = 0.85;
- float BLINK_FREQ = 5;
- picalpha = BLINK_BASE + BLINK_FACTOR * cos(time * BLINK_FREQ);
- }
+ picalpha = blink(0.85, 0.15, 5);
else
picalpha = 0.5;
t = floor(item_time - time + 0.999);