]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Finish off activator (it's unused, so using it doesn't make sense)
authorMario <mario@smbclan.net>
Sun, 27 Mar 2016 11:32:48 +0000 (21:32 +1000)
committerMario <mario@smbclan.net>
Sun, 27 Mar 2016 11:32:48 +0000 (21:32 +1000)
qcsrc/common/triggers/subs.qh
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/trigger/keylock.qc

index 557bc8621296d7a002cb080bff14430a4ead902b..8c62a01c550990a02cc8121a73373693dfd2e9cb 100644 (file)
@@ -58,7 +58,7 @@ void SUB_VanishOrRemove (entity ent);
 .string  platmovetype;
 .float platmovetype_start, platmovetype_end;
 
-entity activator;
+//entity activator;
 
 .string killtarget;
 
index 3a8eb7b363d0ca0ba23e0ddfe164cf9531dc6ca7..f02b2962573700803eab808837a1661aa51f8fdd 100644 (file)
@@ -37,7 +37,6 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
        string key, value, valuefield, valueoffset, valueoffsetrandom;
        entity valueent;
        vector data, data2;
-       entity oldactivator;
 
        n = tokenize_console(msg);
 
@@ -218,11 +217,7 @@ void target_spawn_edit_entity(entity this, entity e, string msg, entity kt, enti
                                value = strcat("target_spawn_helper", value);
                        putentityfieldstring(target_spawn_spawnfunc_field, e, value);
 
-                       oldactivator = activator;
-
-                       activator = act;
                        WITHSELF(e, e.target_spawn_spawnfunc(e));
-                       activator = oldactivator;
 
                        // We called an external function, so we have to re-tokenize msg.
                        n = tokenize_console(msg);
@@ -286,7 +281,7 @@ void target_spawn_use(entity this, entity actor, entity trigger)
        else if(this.target == "*activator")
        {
                // edit entity
-               if(activator)
+               if(actor)
                        target_spawn_useon(actor, this, actor, trigger);
        }
        else
index 5b24b1b63f2848b23f143829f9bb18aa68157113..cc45e2490fd5e6641af04b86771bf91b0a97a01e 100644 (file)
@@ -1,11 +1,11 @@
 /**
  * trigger given targets
  */
-void trigger_keylock_trigger(string s)
-{SELFPARAM();
+void trigger_keylock_trigger(entity this, entity actor, string s)
+{
        for(entity t = world; (t = find(t, targetname, s)); )
                if(t.use1)
-                       t.use1(t, NULL, this);
+                       t.use1(t, actor, this);
 }
 
 /**
@@ -31,8 +31,6 @@ void trigger_keylock_touch()
        if(self.itemkeys)
                key_used = item_keys_usekey(self, other);
 
-       activator = other;
-
        if(self.itemkeys)
        {
 #ifdef SVQC
@@ -57,7 +55,7 @@ void trigger_keylock_touch()
                if(self.delay <= time || started_delay == true)
                if(self.target2)
                {
-                       trigger_keylock_trigger(self.target2);
+                       trigger_keylock_trigger(this, other, self.target2);
                        started_delay = true;
                        self.delay = time + self.wait;
                }
@@ -71,7 +69,7 @@ void trigger_keylock_touch()
 #endif
 
                if(self.target)
-                       trigger_keylock_trigger(self.target);
+                       trigger_keylock_trigger(this, other, self.target);
 
                if(self.killtarget)
                        trigger_keylock_kill(self.killtarget);