]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/triggers/triggers.qc
Merge branch 'master' into terencehill/hud_shake_fix
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / triggers / triggers.qc
index 617fcd40268006bf7a0297289ec764ee42cf7601..a9050357f6e97b5bf7851968239bb266404b5f57 100644 (file)
@@ -2,8 +2,8 @@ void SUB_DontUseTargets(entity this, entity actor, entity trigger) { }
 
 void SUB_UseTargets(entity this, entity actor, entity trigger);
 
-void DelayThink()
-{SELFPARAM();
+void DelayThink(entity this)
+{
        SUB_UseTargets (this, this.enemy, NULL);
        remove(this);
 }
@@ -41,8 +41,7 @@ void trigger_init(entity this)
 
 void trigger_link(entity this, bool(entity this, entity to, int sendflags) sendfunc)
 {
-       this.SendEntity = SendEntity_self;
-       this.SendEntity3 = sendfunc;
+       setSendEntity(this, sendfunc);
        this.SendFlags = 0xFFFFFF;
 }
 
@@ -170,16 +169,16 @@ SUB_UseTargets
 
 the global "activator" should be set to the entity that initiated the firing.
 
-If self.delay is set, a DelayedUse entity will be created that will actually
+If this.delay is set, a DelayedUse entity will be created that will actually
 do the SUB_UseTargets after that many seconds have passed.
 
-Centerprints any self.message to the activator.
+Centerprints any this.message to the activator.
 
-Removes all entities with a targetname that match self.killtarget,
+Removes all entities with a targetname that match this.killtarget,
 and removes them, so some events can remove other triggers.
 
 Search for (string)targetname in all entities that
-match (string)self.target and call their .use function
+match (string)this.target and call their .use function
 
 ==============================
 */
@@ -193,7 +192,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
        // create a temp object to fire at a later time
                entity t = new(DelayedUse);
                t.nextthink = time + this.delay;
-               t.think = DelayThink;
+               setthink(t, DelayThink);
                t.enemy = actor;
                t.message = this.message;
                t.killtarget = this.killtarget;
@@ -225,7 +224,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
        s = this.killtarget;
        if (s != "")
        {
-               for(entity t = world; (t = find(t, targetname, s)); )
+               for(entity t = NULL; (t = find(t, targetname, s)); )
                        remove(t);
        }
 #endif
@@ -252,7 +251,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
                        // Flag to set func_clientwall state
                        // 1 == deactivate, 2 == activate, 0 == do nothing
                        int aw_flag = this.antiwall_flag;
-                       for(entity t = world; (t = find(t, targetname, s)); )
+                       for(entity t = NULL; (t = find(t, targetname, s)); )
                        {
                                if(t.use)
                                {
@@ -276,7 +275,7 @@ void SUB_UseTargets(entity this, entity actor, entity trigger)
                RandomSelection_chosen_ent.use(RandomSelection_chosen_ent, actor, this);
 }
 
-void SUB_UseTargets_self()
-{SELFPARAM();
+void SUB_UseTargets_self(entity this)
+{
        SUB_UseTargets(this, NULL, NULL);
 }