]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/lib/warpzone/server.qc
Merge remote-tracking branch 'origin/terencehill/bot_waypoints'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / lib / warpzone / server.qc
index 8246e106de54165f014b548b50adb247009a7a91..a81d0c4fb777a122fabab58222be9677d116d6ff 100644 (file)
@@ -6,10 +6,11 @@
 #elif defined(SVQC)
        #include <common/constants.qh>
        #include <common/net_linked.qh>
-       #include <common/triggers/subs.qh>
+       #include <common/mapobjects/subs.qh>
        #include <common/util.qh>
        #include <server/constants.qh>
        #include <server/defs.qh>
+       #include <server/utils.qh>
 #endif
 
 #ifdef WARPZONELIB_KEEPDEBUG
@@ -42,11 +43,17 @@ void WarpZone_TeleportPlayer(entity teleporter, entity player, vector to, vector
        player.lastteleporttime = time;
 #endif
        setorigin(player, to); // NOTE: this also aborts the move, when this is called by touch
+       player.angles = to_angles;
 #ifdef SVQC
        player.oldorigin = to; // for DP's unsticking
        player.fixangle = true;
+       if (IS_BOT_CLIENT(player))
+       {
+               // FIXME find a way to smooth view's angles change for bots too
+               player.v_angle = player.angles;
+               bot_aim_reset(player);
+       }
 #endif
-       player.angles = to_angles;
        player.velocity = to_velocity;
 
        BITXOR_ASSIGN(player.effects, EF_TELEPORT_BIT);
@@ -177,11 +184,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.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
-       )
+       if(toucher.move_movetype == MOVETYPE_NONE || toucher.move_movetype == MOVETYPE_FOLLOW || toucher.tag_entity)
                return;
 
        if(WarpZoneLib_ExactTrigger_Touch(this, toucher))