float ticrate;
int serverflags;
+
return = true;
ItemsTime_time[i] = f;
}
+
+NET_HANDLE(TE_CSQC_TOTALSHARDS, bool isNew)
+{
+ // for RJZ
+ total_shards = ReadInt24_t();
+
+ return = true;
+}
+
#endif
#ifdef CSQC
HUD_Write_Cvar("hud_panel_itemstime_dynamicsize");
}
+// for RJZ
+void DrawItemsTimeItemFixed(vector myPos, vector mySize, float ar, string item_icon, float t)
+{
+ vector picpos, numpos;
+ if (autocvar_hud_panel_itemstime_iconalign)
+ {
+ numpos = myPos;
+ picpos = myPos + eX * (ar - 1) * mySize_y;
+ }
+ else
+ {
+ numpos = myPos + eX * mySize_y;
+ picpos = myPos;
+ }
+
+ drawstring_aspect(numpos, ftos(t), vec2(((ar - 1)/ar) * mySize.x, mySize.y), '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+ drawpic_aspect_skin(picpos, item_icon, '1 1 0' * mySize_y, '1 1 1', panel_fg_alpha, DRAWFLAG_NORMAL);
+}
+
void DrawItemsTimeItem(vector myPos, vector mySize, float ar, string item_icon, float item_time, bool item_available, float item_availableTime)
{
float t = 0;
});
count += (Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) != -1);
}
+ // for RJZ
+ if (total_shards != -1)
+ count++;
+
if (count == 0)
return;
FOREACH(Items, Item_ItemsTime_Allow(it) && Item_ItemsTime_GetTime(it.m_id) != -1, {
id = it.m_id;
icon = it.m_icon;
+
LABEL(iteration)
float item_time = Item_ItemsTime_GetTime(id);
if(id == REGISTRY_MAX(Items)) // can happen only in the last fake iteration
break;
});
+
+ // for RJZ
+ if(total_shards != -1) {
+ DrawItemsTimeItemFixed(pos + vec2(column * (itemstime_size.x + offset.x), row * (itemstime_size.y + offset.y)), itemstime_size, ar, "armor", total_shards);
+ ++row;
+ if (row >= rows)
+ {
+ row = 0;
+ column = column + 1;
+ }
+ }
+
// add another fake iteration for superweapons time
if(id < REGISTRY_MAX(Items) && Item_ItemsTime_GetTime(REGISTRY_MAX(Items)) != -1)
{
#pragma once
+#ifdef CSQC
+int total_shards = -1;
+#endif
+
#ifdef SVQC
int autocvar_sv_itemstime;
#endif
REGISTER_NET_TEMP(TE_CSQC_TEAMNAMES)
REGISTER_NET_TEMP(TE_CSQC_CHATSOUND)
REGISTER_NET_TEMP(TE_CSQC_WEAPONPICKUP)
+REGISTER_NET_TEMP(TE_CSQC_TOTALSHARDS) // for RJZ
const int RACE_NET_CHECKPOINT_HIT_QUALIFYING = 0; // byte checkpoint, short time, short recordtime, string recordholder
const int RACE_NET_CHECKPOINT_CLEAR = 1;
if (CS(this).just_joined)
CS(this).just_joined = false;
+
+ // for RJZ
+ if (autocvar_g_count_shards) {
+ total_shards = 0;
+ send_TotalShards(this);
+ }
}
int player_getspecies(entity this)
pickedup |= Item_GiveAmmoTo(item, player, RES_CELLS, g_pickup_cells_max);
pickedup |= Item_GiveAmmoTo(item, player, RES_PLASMA, g_pickup_plasma_max);
pickedup |= Item_GiveAmmoTo(item, player, RES_FUEL, g_pickup_fuel_max);
+
+ // for RJZ
+ if (autocvar_g_count_shards && item.itemdef == ITEM_ArmorSmall) {
+ total_shards++;
+ send_TotalShardsAll();
+ }
+
if (item.itemdef.instanceOfWeaponPickup)
{
WepSet w, wp;
const float SPAWNFLAG_NO_WAYPOINTS_FOR_ITEMS = 1;
+void send_TotalShards(entity to) {
+ // for RJZ
+ // Send total number of picked up shards
+ if(!autocvar_g_count_shards) return;
+ if(!IS_REAL_CLIENT(to)) return;
+
+ msg_entity = to;
+ WriteHeader(MSG_ONE, TE_CSQC_TOTALSHARDS);
+ WriteInt24_t(MSG_ONE, total_shards);
+}
+
+void send_TotalShardsAll() {
+ // for RJZ
+ // Send total number of picked up shards
+ if(!autocvar_g_count_shards) return;
+
+ FOREACH_CLIENT(IS_REAL_CLIENT(it) && (IS_SPEC(it) || IS_OBSERVER(it)), {
+ send_TotalShards(it);
+ });
+}
+
void SetDefaultAlpha()
{
if (!MUTATOR_CALLHOOK(SetDefaultAlpha))
.vector dropped_origin;
void droptofloor(entity this);
+/* z411 for RJZ */
+bool autocvar_g_count_shards = false;
+int total_shards = 0;
+void send_TotalShards(entity to);
+void send_TotalShardsAll();
+
IntrusiveList g_moveables;
STATIC_INIT(g_moveables) { g_moveables = IL_NEW(); }