]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/secret.qc
Remove SELFPARAM() from .think and .touch
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / secret.qc
index 267c69a8c9e5f7b29b767dc2814d9acb38d79be1..a6f40be3ea5521a909f7d0df6c649e995e0da39c 100644 (file)
@@ -1,23 +1,24 @@
 #if defined(CSQC)
 #elif defined(MENUQC)
 #elif defined(SVQC)
-       #include "../../..//dpdefs/progsdefs.qh"
-    #include "../../util.qh"
-    #include "../../../server/defs.qh"
+    #include <common/util.qh>
+    #include <server/defs.qh>
     #include "secret.qh"
 #endif
 
 #ifdef SVQC
 
-void secrets_setstatus() {
-       self.stat_secrets_total = secrets_total;
-       self.stat_secrets_found = secrets_found;
+void secrets_setstatus()
+{SELFPARAM();
+       this.stat_secrets_total = secrets_total;
+       this.stat_secrets_found = secrets_found;
 }
 
 /**
  * A secret has been found (maybe :P)
  */
-void trigger_secret_touch() {
+void trigger_secret_touch(entity this)
+{
        // only a player can trigger this
        if (!IS_PLAYER(other))
                return;
@@ -32,7 +33,7 @@ void trigger_secret_touch() {
        self.message = "";
 
        // handle normal trigger features
-       multi_touch();
+       multi_touch(self);
        remove(self);
 }
 
@@ -49,37 +50,38 @@ killtarget: remove all entities with this targetname when triggered
 You should create a common/trigger textured brush covering the entrance to a secret room/area.
 Trigger secret can only be trigger by a player's touch and can not be a target itself.
 */
-void spawnfunc_trigger_secret() {
+spawnfunc(trigger_secret)
+{
        // FIXME: should it be disabled in most modes?
 
        // update secrets count
        secrets_total += 1;
 
        // add default message
-       if (self.message == "")
-               self.message = "You found a secret!";
+       if (this.message == "")
+               this.message = "You found a secret!";
 
        // set default sound
-       if (self.noise == "")
-       if (!self.sounds)
-               self.sounds = 1; // misc/secret.wav
+       if (this.noise == "")
+       if (!this.sounds)
+               this.sounds = 1; // misc/secret.wav
 
        // this entity can't be a target itself!!!!
-       self.targetname = "";
+       this.targetname = "";
 
        // you can't just shoot a room to find it, can you?
-       self.health = 0;
+       this.health = 0;
 
        // a secret can not be delayed
-       self.delay = 0;
+       this.delay = 0;
 
        // convert this trigger to trigger_once
-       self.classname = "trigger_once";
-       spawnfunc_trigger_once();
+       this.classname = "trigger_once";
+       spawnfunc_trigger_once(this);
 
        // take over the touch() function, so we can mark secret as found
-       self.touch = trigger_secret_touch;
+       settouch(this, trigger_secret_touch);
        // ignore triggering;
-       self.use = func_null;
+       this.use = func_null;
 }
 #endif