]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/trigger/multi.qc
Merge branch 'master' into terencehill/translate_colors_2
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / trigger / multi.qc
index fd3917d33be3fec7fa623f27b18c0066d4dca30a..3f0a4b27fef60d5058fba15f2298da394ae14950 100644 (file)
@@ -99,19 +99,19 @@ void multi_touch()
        multi_trigger ();
 }
 
-void multi_eventdamage (entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
-{SELFPARAM();
-       if (!self.takedamage)
+void multi_eventdamage(entity this, entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+{
+       if(!this.takedamage)
                return;
-       if(self.spawnflags & DOOR_NOSPLASH)
+       if(this.spawnflags & DOOR_NOSPLASH)
                if(!(DEATH_ISSPECIAL(deathtype)) && (deathtype & HITTYPE_SPLASH))
                        return;
-       self.health = self.health - damage;
-       if (self.health <= 0)
+       this.health = this.health - damage;
+       if (this.health <= 0)
        {
-               self.enemy = attacker;
-               self.goalentity = inflictor;
-               multi_trigger();
+               this.enemy = attacker;
+               this.goalentity = inflictor;
+               WITHSELF(this, multi_trigger());
        }
 }
 
@@ -147,19 +147,14 @@ spawnfunc(trigger_multiple)
 {
        self.reset = multi_reset;
        if (self.sounds == 1)
-       {
-               precache_sound ("misc/secret.wav");
                self.noise = "misc/secret.wav";
-       }
        else if (self.sounds == 2)
-       {
                self.noise = strzone(SND(TALK));
-       }
        else if (self.sounds == 3)
-       {
-               precache_sound ("misc/trigger1.wav");
                self.noise = "misc/trigger1.wav";
-       }
+
+       if(self.noise)
+               precache_sound(self.noise);
 
        if (!self.wait)
                self.wait = 0.2;