]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/func/ladder.qc
Merge branch 'master' into terencehill/bot_waypoints
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / func / ladder.qc
index af5065643bf9a6957fd0de37d50cba53a7f58d9c..58c726360fcac469dc640f8962be1d5ac6ef5272 100644 (file)
@@ -1,21 +1,22 @@
+#include "ladder.qh"
 REGISTER_NET_LINKED(ENT_CLIENT_LADDER)
 
-void func_ladder_touch(entity this)
+void func_ladder_touch(entity this, entity toucher)
 {
 #ifdef SVQC
-       if (!other.iscreature)
+       if (!toucher.iscreature)
                return;
-       if(IS_VEHICLE(other))
+       if(IS_VEHICLE(toucher))
                return;
 #elif defined(CSQC)
-       if(!other.isplayermodel)
+       if(!toucher.isplayermodel)
                return;
 #endif
 
-       EXACTTRIGGER_TOUCH;
+       EXACTTRIGGER_TOUCH(this, toucher);
 
-       other.ladder_time = time + 0.1;
-       other.ladder_entity = this;
+       toucher.ladder_time = time + 0.1;
+       toucher.ladder_entity = this;
 }
 
 #ifdef SVQC
@@ -44,6 +45,10 @@ void func_ladder_init(entity this)
 
        trigger_init(this);
        func_ladder_link(this);
+       vector top = (this.absmin + this.absmax) / 2;
+       top.z = this.absmax.z + 1 - PL_MIN_CONST.z;
+       float height = this.absmax.z - this.absmin.z;
+       waypoint_spawnforteleporter_boxes(this, WAYPOINTFLAG_LADDER, this.absmin, this.absmax, top, top, height);
 }
 
 spawnfunc(func_ladder)