]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/server.qc
Merge branch 'DefaultUser/m_itemid' into 'master'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / server.qc
index 5262ca6de3a094ff2e46c6ddddeb7ab91651fe24..116ad00023ae98b1a4321c609698298a2dd46f0b 100644 (file)
@@ -5,9 +5,9 @@
 #elif defined(MENUQC)
 #elif defined(SVQC)
        #include <common/constants.qh>
+       #include <common/net_linked.qh>
        #include <common/triggers/subs.qh>
        #include <common/util.qh>
-       #include <server/command/common.qh>
        #include <server/constants.qh>
        #include <server/defs.qh>
 #endif
@@ -175,8 +175,7 @@ void WarpZone_Touch(entity this, entity toucher)
                return;
 
        // FIXME needs a better check to know what is safe to teleport and what not
-       if(toucher.movetype == MOVETYPE_NONE || toucher.movetype == MOVETYPE_FOLLOW || toucher.tag_entity
-       || toucher.move_movetype == MOVETYPE_NONE || toucher.move_movetype == MOVETYPE_FOLLOW
+       if((toucher.move_movetype == MOVETYPE_NONE && toucher.move_movetype == MOVETYPE_NONE) || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.tag_entity
 #ifdef CSQC
        || tag_networkentity
 #endif
@@ -226,7 +225,7 @@ void WarpZone_Touch(entity this, entity toucher)
        }
        else
        {
-               LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))\n");
+               LOG_TRACE("WARPZONE FAIL AHAHAHAHAH))");
        }
 }
 
@@ -632,7 +631,6 @@ void WarpZone_InitStep_ClearTarget(entity this)
        this.enemy = NULL;
 }
 
-entity warpzone_first; .entity warpzone_next;
 void WarpZone_InitStep_FindTarget(entity this)
 {
        float i;
@@ -732,6 +730,8 @@ spawnfunc(trigger_warpzone)
        BITSET_ASSIGN(this.effects, EF_NODEPTHTEST);
        this.warpzone_next = warpzone_first;
        warpzone_first = this;
+
+       IL_PUSH(g_warpzones, this);
 }
 spawnfunc(func_camera)
 {
@@ -804,10 +804,19 @@ void WarpZone_StartFrame()
                WarpZone_PostInitialize_Callback();
        }
 
-       FOREACH_ENTITY(!is_pure(it),
+       if(warpzone_warpzones_exist)
        {
-               if(warpzone_warpzones_exist)
+               IL_EACH(g_projectiles, true,
+               {
                        WarpZone_StoreProjectileData(it);
+               });
+       }
+               
+
+       FOREACH_CLIENT(true,
+       {
+               if(warpzone_warpzones_exist)
+                       WarpZone_StoreProjectileData(it); // TODO: not actually needed
 
                if(IS_OBSERVER(it) || it.solid == SOLID_NOT)
                if(IS_CLIENT(it)) // we don't care about it being a bot
@@ -836,9 +845,10 @@ void WarpZone_StartFrame()
 .float warpzone_reconnecting;
 bool visible_to_some_client(entity ent)
 {
-       FOREACH_ENTITY(!IS_NOT_A_CLIENT(it), LAMBDA(
-               if (IS_PLAYER(it) && IS_REAL_CLIENT(it) && checkpvs(it.origin + it.view_ofs, ent)) return true;
-       ));
+       FOREACH_CLIENT(IS_PLAYER(it) && IS_REAL_CLIENT(it) && checkpvs(it.origin + it.view_ofs, ent),
+       {
+               return true;
+       });
        return false;
 }
 void trigger_warpzone_reconnect_use(entity this, entity actor, entity trigger)