]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a level warp target entity to allow maps to trigger skipping ahead in a campaign...
authorMario <mario@smbclan.net>
Thu, 16 Feb 2017 13:54:27 +0000 (23:54 +1000)
committerMario <mario@smbclan.net>
Thu, 16 Feb 2017 13:54:27 +0000 (23:54 +1000)
qcsrc/common/triggers/target/_mod.inc
qcsrc/common/triggers/target/_mod.qh
qcsrc/common/triggers/target/include.qc
qcsrc/common/triggers/target/levelwarp.qc [new file with mode: 0644]
qcsrc/common/triggers/target/levelwarp.qh [new file with mode: 0644]

index 195d5e53481348a3041d8ef783088f6f35c0296e..71bd8c11e9c4865fb3f27b6142a697dca5b0c8aa 100644 (file)
@@ -1,6 +1,7 @@
 // generated file; do not modify
 #include <common/triggers/target/changelevel.qc>
 #include <common/triggers/target/include.qc>
+#include <common/triggers/target/levelwarp.qc>
 #include <common/triggers/target/location.qc>
 #include <common/triggers/target/music.qc>
 #include <common/triggers/target/spawn.qc>
index a5462d497e087000875ca9837d654066ce037075..6b06b75f10ef9c672238ffbd985824be6403a5c9 100644 (file)
@@ -1,6 +1,7 @@
 // generated file; do not modify
 #include <common/triggers/target/changelevel.qh>
 #include <common/triggers/target/include.qh>
+#include <common/triggers/target/levelwarp.qh>
 #include <common/triggers/target/location.qh>
 #include <common/triggers/target/music.qh>
 #include <common/triggers/target/spawn.qh>
index c53ea6d173121365535b4ff3bf1cf63bad848b31..c643e47857374ea95411805f301221e4383ab229 100644 (file)
@@ -1,6 +1,7 @@
 #include "include.qh"
 
 #include "changelevel.qc"
+#include "levelwarp.qc"
 #include "location.qc"
 #include "music.qc"
 #include "spawn.qc"
diff --git a/qcsrc/common/triggers/target/levelwarp.qc b/qcsrc/common/triggers/target/levelwarp.qc
new file mode 100644 (file)
index 0000000..6cef53d
--- /dev/null
@@ -0,0 +1,19 @@
+#include "levelwarp.qh"
+
+#ifdef SVQC
+void target_levelwarp_use(entity this, entity actor, entity trigger)
+{
+       if(!autocvar_g_campaign)
+               return; // only in campaign
+
+       if(this.cnt)
+               CampaignLevelWarp(this.cnt - 1); // specific level
+       else
+               CampaignLevelWarp(-1); // next level
+}
+
+spawnfunc(target_levelwarp)
+{
+       this.use = target_levelwarp_use;
+}
+#endif
diff --git a/qcsrc/common/triggers/target/levelwarp.qh b/qcsrc/common/triggers/target/levelwarp.qh
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once