]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/t_items.qc
FOREACH_ENTITY_RADIUS
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / t_items.qc
index 876bc6347a5e9cc8c1d4a11decca8b61f6ae4ea3..1d3ce373d2bed7970caf3f3a3e8b7c917978ab8a 100644 (file)
@@ -15,7 +15,7 @@
 
     #include "constants.qh"
     #include <common/deathtypes/all.qh>
-    #include <common/notifications.qh>
+    #include <common/notifications/all.qh>
        #include "triggers/subs.qh"
     #include "util.qh"
 
@@ -582,7 +582,8 @@ void Item_RespawnThink()
 
 void Item_ScheduleRespawnIn(entity e, float t)
 {
-       if (Item_ItemsTime_Allow(e.itemdef) || e.weapons & WEPSET_SUPERWEAPONS)
+       // if the respawn time is longer than 10 seconds, show a waypoint, otherwise, just respawn normally
+       if ((Item_ItemsTime_Allow(e.itemdef) || e.weapons & WEPSET_SUPERWEAPONS) && (t - ITEM_RESPAWN_TICKS) > 0)
        {
                e.think = Item_RespawnCountdown;
                e.nextthink = time + max(0, t - ITEM_RESPAWN_TICKS);
@@ -1154,16 +1155,12 @@ void _StartItem(entity this, entity def, float defaultrespawntime, float default
 
                if(autocvar_spawn_debug >= 2)
                {
-                       for(entity otheritem = findradius(this.origin, 3); otheritem; otheritem = otheritem.chain)
-                       {
-                           // why not flags & fl_item?
-                               if(otheritem.is_item)
-                               {
-                                       LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin));
-                                       LOG_TRACE(" vs ", otheritem.netname, vtos(otheritem.origin), "\n");
-                                       error("Mapper sucks.");
-                               }
-                       }
+            // why not flags & fl_item?
+                   FOREACH_ENTITY_RADIUS(this.origin, 3, it.is_item, {
+                LOG_TRACE("XXX Found duplicated item: ", itemname, vtos(this.origin));
+                LOG_TRACE(" vs ", it.netname, vtos(it.origin), "\n");
+                error("Mapper sucks.");
+            });
                        this.is_item = true;
                }