]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/target/voicescript.qc
Merge branch 'master' into terencehill/hud_shake_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / target / voicescript.qc
index 35d84da8df64de4a95e82f2debc9847bec413764..bdf1e0f1fb40e856f89823b0d3e347aae9a3be03 100644 (file)
@@ -6,16 +6,16 @@
 
 void target_voicescript_clear(entity pl)
 {
-       pl.voicescript = world;
+       pl.voicescript = NULL;
 }
 
-void target_voicescript_use()
-{SELFPARAM();
-       if(activator.voicescript != self)
+void target_voicescript_use(entity this, entity actor, entity trigger)
+{
+       if(actor.voicescript != this)
        {
-               activator.voicescript = self;
-               activator.voicescript_index = 0;
-               activator.voicescript_nextthink = time + self.delay;
+               actor.voicescript = this;
+               actor.voicescript_index = 0;
+               actor.voicescript_nextthink = time + this.delay;
        }
 }
 
@@ -67,14 +67,14 @@ void target_voicescript_next(entity pl)
                        }
                        else
                        {
-                               pl.voicescript = world; // stop trying then
+                               pl.voicescript = NULL; // stop trying then
                        }
                }
        }
 }
 
-void spawnfunc_target_voicescript()
-{SELFPARAM();
+spawnfunc(target_voicescript)
+{
        // netname: directory of the sound files
        // message: list of "sound file" duration "sound file" duration, a *, and again a list
        //          foo1 4.1 foo2 4.0 foo3 -3.1 * fool1 1.1 fool2 7.1 fool3 9.1 fool4 3.7
@@ -84,18 +84,18 @@ void spawnfunc_target_voicescript()
        // delay: initial delay before the first message
 
        float i, n;
-       self.use = target_voicescript_use;
+       this.use = target_voicescript_use;
 
-       n = tokenize_console(self.message);
-       self.cnt = n / 2;
+       n = tokenize_console(this.message);
+       this.cnt = n / 2;
        for(i = 0; i+1 < n; i += 2)
        {
                if(argv(i) == "*")
                {
-                       self.cnt = i / 2;
+                       this.cnt = i / 2;
                        ++i;
                }
-               precache_sound(strcat(self.netname, "/", argv(i), ".wav"));
+               precache_sound(strcat(this.netname, "/", argv(i), ".wav"));
        }
 }
 #endif