void Item_RespawnCountdown(entity this)
{
+ if(game_timeout) { this.nextthink = time + 1; return; }
+
if(this.item_respawncounter >= ITEM_RESPAWN_TICKS)
{
if(this.waypointsprite_attached)
else
{
this.nextthink = time + 1;
- this.item_respawncounter += 1;
+ this.item_respawncounter = floor((time - game_starttime) - (this.scheduledrespawntime - ITEM_RESPAWN_TICKS)) + 1;
+ //this.item_respawncounter += 1;
+ //LOG_INFOF("Respawncounter: %d", this.item_respawncounter);
+ if(this.item_respawncounter < 1) return;
+
if(this.item_respawncounter == 1)
{
do {
void Item_RespawnThink(entity this)
{
- this.nextthink = time;
+ this.nextthink = time + 1;
if(this.origin != this.oldorigin)
ItemUpdate(this);
-
- if(time >= this.wait)
+
+ if(!game_timeout && time - game_starttime >= this.wait)
Item_Respawn(this);
+
+ //LOG_INFOF("time until respawn %d", (this.wait) - (time - game_starttime));
}
void Item_ScheduleRespawnIn(entity e, float t)
if ((Item_ItemsTime_Allow(e.itemdef) || (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS) || MUTATOR_CALLHOOK(Item_ScheduleRespawn, e, t)) && (t - ITEM_RESPAWN_TICKS) > 0)
{
setthink(e, Item_RespawnCountdown);
- e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
- e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS;
+ //e.nextthink = time - timeout_total_time + max(0, t - ITEM_RESPAWN_TICKS);
+ //e.scheduledrespawntime = e.nextthink + ITEM_RESPAWN_TICKS;
+ e.nextthink = time;
+ e.scheduledrespawntime = time - game_starttime + t;
e.item_respawncounter = 0;
+
if(Item_ItemsTime_Allow(e.itemdef) || (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
{
t = Item_ItemsTime_UpdateTime(e, e.scheduledrespawntime);
{
setthink(e, Item_RespawnThink);
e.nextthink = time;
- e.scheduledrespawntime = time + t;
- e.wait = time + t;
+ e.scheduledrespawntime = time - game_starttime + t;
+ e.wait = time - game_starttime + t;
if(Item_ItemsTime_Allow(e.itemdef) || (STAT(WEAPONS, e) & WEPSET_SUPERWEAPONS))
{
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_rjz_count_shards && !warmup_stage && item.itemdef == ITEM_ArmorSmall) {
+ total_shards++;
+ send_TotalShardsAll();
+ }
+
if (item.itemdef.instanceOfWeaponPickup)
{
WepSet w, wp;
void setItemGroupCount()
{
- for (int k = 1; k <= group_count; k++)
+ for (int k = 1; k <= group_count; ++k)
{
int count = 0;
IL_EACH(g_items, IS_SMALL(it.itemdef) && it.item_group == k, { count++; });